summaryrefslogtreecommitdiff
path: root/test/normal/selection-undo
AgeCommit message (Collapse)Author
2023-05-09Map undo selection change to <a-u>/<a-U>Johannes Altmanninger
Change the initial <c-h>/<c-k> bindings to the recently freed-up <a-u></a-U>. Pros: - easier to remember - the redo binding is logical. - works on legacy terminals, unlike <c-h> Cons: - It's less convenient to toggle between selection undo and redo keys. I think this is okay since this scenario does not happen that often in practice.
2022-12-27Make selection undo skip over entries that are nop after buffer changeJohannes Altmanninger
After buffer modification - in particular after deletion - adjacent selection history entries may correspond to the same effective selection when applied to the current buffer. This means that we sometimes need to press <c-h> multiple times to make one visible change. This is not what the user expects, so let's keep walking the selection history until we hit an actual change. Alternatively, we could minimize the selection history after buffer changes but I think that would make the it worse after content undo+redo.
2022-12-27Tweak selection-undo interaction with WinDisplay hooksJohannes Altmanninger
Each selection undo operation is surrounded by pair of begin_edition()/end_edition() calls. The original reason for adding these was that in one of my preliminary versions, a WinDisplay hook could break an undo chain, even if the hook did not affect selections at all. This has since been fixed. By surrounding the undo with begin_edition()/end_edition(), try to ensure that any selection modification that happens in a WinDisplay hook would not break the undo chain. Essentially this means that, after using <c-h> to undo a buffer change, this was meant to make sure that <c-k> could redo that buffer change. However, it turns out this actually doesn't work. The attached test case triggers an assertion. As described in the first paragraph, the only real-world motivation for this is gone, so let's simplify the behavior. The assertion fix means that we can test the next commit better.
2022-12-27Add tests for selection undoJohannes Altmanninger