Reputation: 36557
Right now I have the following mapping to select lines forward:
{ "keys": ["ctrl+alt+down"] , "command": "select_lines", "args": {"forward": true} }
I'd like ctrl+alt+up to simply undo the last ctrl+alt+down. Soft undo doesn't quite work. If you select multiple lines quickly then the undo de-selects them all, instead of just the last one selected.
If there's no out-of-the-box way to do this then maybe I could map ctrl+alt+up to a set of keystrokes that deselects the current line and moves the cursor up one?
Upvotes: 4
Views: 436
Reputation: 43234
this behavior bugged me a lot too, so I've just went and wrote this: https://github.com/kizu/undo_select_lines#readme
This overrides the “soft undo” action in certain context, so it would actually “undo” the single select_lines
.
The only downside is that there won’t be redo and the history would be a bit dirty, but whatever while it works.
So, if you didn’t override soft undo in your key bindings, installing this command through git in your Packages:
git clone git://github.com/kizu/undo_select_lines.git
Or download it there.
would fix this problem for you. Otherwise, look at how it’s implemented in the source, so you should replace the keybindings for your “soft undo”.
Upvotes: 3