diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-27 16:12:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-27 16:12:11 -0400 |
| commit | 7e2e3f8c255f7ae65bd9fdc3feba6b4efd21416f (patch) | |
| tree | 2811ec4483765c12d5fe30bac5c4f950b2bc9557 /runtime/syntax/python.vim | |
| parent | 617f9e628c3d4b3945ae7d8422f0c91e167efbfe (diff) | |
| download | rneovim-7e2e3f8c255f7ae65bd9fdc3feba6b4efd21416f.tar.gz rneovim-7e2e3f8c255f7ae65bd9fdc3feba6b4efd21416f.tar.bz2 rneovim-7e2e3f8c255f7ae65bd9fdc3feba6b4efd21416f.zip | |
feat(editor): undo restores cursor position #41520
Problem:
Undo places the cursor wherever the cursor happened to sit at "save
time" (`uh_cursor` is sampled lazily on the first change).
Examples:
- `i` preserves, but `a` does not
- `diw`, `atest<Esc>`, `d^` abandon the original position
- `D`, `o` restore it (by accident).
Solution:
`composite` tracks the pending atom (and its `origin`) across frames.
A `stuffed` continuation frame inherits the `origin` + prepped redo.
Store `origin` info in the undo header, so undo can restore it.
- Not for a mid-command undo break (i_CTRL-G_u).
- Undoing a mapping restores where the mapping started (which
technically may be different than where the "edit" started).
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions