3 ms·
> This seems to push a history state as I click around the app. Please don’t do this; if you want to store (selection) state in the history that’s fine but use
by nicoburns 5y ago
> This seems to push a history state as I click around the app. Please don’t do this; if you want to store (selection) state in the history that’s fine but use replace semantics instead.
Sublime text handles this in the best way I've seen. The undo-stack stores selection changes, but Ctrl-Z ignores them and undoes directly back to the last actual edit. There is a separate keyboard shortcut (Ctrl-U) that does "Undo Selection". So it's out of the way unless you need it, at which point it's super useful (e.g. if you spent some time making a complex multi-selection that accidentally mess it up)
- tylorr 5y agoI've wanted undo selection so many times in Sublime Text and I had no idea this existed, thank you!