Commit Graph

2 Commits

Author SHA1 Message Date
Johannes Altmanninger
7d2bae63b9 Map undo selection change to <a-u>/<a-U>
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.
2023-05-09 11:32:37 +02:00
Johannes Altmanninger
516759bb2f Make selection undo skip over entries that are nop after buffer change
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-27 18:24:55 +01:00