[sublime] Sublime-style smart backspace#3127
[sublime] Sublime-style smart backspace#3127vincentwoo wants to merge 1 commit intocodemirror:masterfrom
Conversation
keymap/sublime.js
Outdated
There was a problem hiding this comment.
You should be able to use CodeMirror.countColumn(cm.getLine(cursor.line), cursor.ch, tabSize) to get the column at which the cursor is. That's probably cleaner.
|
Okay, I took your advice on |
|
Thanks! Out of curiosity, can you explain how/when |
|
They should usually be set to the same value, but |
|
I've reverted this in 55a47a5, because
See #4023 |
|
My colleagues and I see this default backspace behavior on sublime 2 and 3, with no customizations to the keybindings. It might be relevant that we all use OSX. Would you be okay with merging a version of this that works correctly with multiple cursors? I can take a crack at it. |
|
Sure, I'd merge a proper implementation. |
In Sublime, when you hit backspace, the editor checks to see if everything proceeding your cursor is whitespace. If it is, and your cursor is on an even multiple of the tab size, it will simply delete one full tab, which is pretty nice.
I've tried to mimic this here. It's a bit hacky without some defined API for figuring out the real length of hard vs soft tabs but I think this suffices. Thoughts?