Sublime Forum

Removing last selected line

#1

Hi everyone.

Does anyone know of a way to undo a single line addition when declaring multiple cursors? When I am pressing CTRL+ALT+UP/DOWN to add lines to my cursor block, sometimes I add one too many and want to remove it. However both CTRL+Z and CTRL+U will remove the entire block selection.

Thanks!

0 Likes

#2

Your question inspired me to finish adding this feature to one of my plugins (Sublime 3 only), since this also bugs me.

sublime.wbond.net/packages/Column%20Select

The issue is that it seems Sublime combines all successive motions into one, even with soft undo. This plugin is a little bit of a hack solution to remember which direction you were going, and undo the last movement if you go the other direction. So if you CTRL+ALT+UP one too many, just press CTRL+ALT+DOWN.

This plugin does a few other things (like adding mouse support, pgup/pgdn/home/end, making begging/end of lines sticky, ignoring lines that are too short). If these other features are in your way, if you know a little Python it should be easy for you to rip out what you don’t want. Or even better, feel free to send me suggestions.

0 Likes

#3

This is fantastic, sapphire! And no worries about the approach - it’s actually what I reflexively do when I run into this (hit UP when selecting one too many going down). I’ll definitely check it out. Thanks!

0 Likes