forked from mawww/kakoune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to redo old branches from selection history
Today, selection undo and jump list commands only travel the latest branch of the selection history. If I undo a selection change and then make another change, the undone change cannot be redone - it lives on an old branch of the selection history. Let's make it possible to revisit such selections. There are a couple of ways to implement this. This version allows to toggle between redo branches whenever there is more than one. Hopefully this is not too hard to use. A previous approach implemented a behavior equivalent to mawww#4777, but that turns out to be clunky for selection undo because when I use <c-o>, I typically only want to travel the active branch and not revisit any abandoned branches. Another approach would be to mimic <a-u>. This week, I finally realized how that command works: it simply decrements the index of the current history item. Since the history tree is stored in a vector, this allows to visit any state. However this also means that it includes weird jumps between branches in the history. I somehow thought that it only jumps between the leaf nodes.. Anyway, I find this a bit unintuitive.
- Loading branch information
Showing
4 changed files
with
91 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters