Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Delete whitespace intelligently or backspace by indentation, e.g. delete four spaces that function as 'a tab' #36

Open
kenny-evitt opened this issue Dec 6, 2015 · 1 comment

Comments

@kenny-evitt
Copy link

See LightTable/LightTable#548 for the original issue. The original comment:

So currently, if I configure LT to insert spaces rather than tabs, what happens when I try to delete the spaces is that I have to delete the spaces one by one, rather than deleting them as tabs (delete 4 spaces at once in my case). Could LT intelligently detect when I want to delete a tab width of spaces?

@cldwalker
Copy link
Member

From LightTable/LightTable#548:
Open to a pull request on Python plugin that does this. CodeMirror provides indentLine which provides a "subtract" to do this. The keybinding would need to be bound to backspace, scoped to just python files and map to a command that does something like the following (haven't tested it in a python file):

(let [ed (pool/last-active)]
      (.indentLine (editor/->cm-ed ed) (.-line (editor/cursor ed)) "subtract" true))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants