diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-04-29 13:09:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-29 13:09:55 +0800 |
| commit | f04dc2fcfc70c5003c3d48e7f1722576a18e9ec8 (patch) | |
| tree | 16a5b4d7ca4d92ea36a3aeda2f7b01524d8cbd5c /runtime/lua/vim/provider/python.lua | |
| parent | c33e60f748ac4fbfcdc327ff85c18a6ff8258f88 (diff) | |
| download | rneovim-f04dc2fcfc70c5003c3d48e7f1722576a18e9ec8.tar.gz rneovim-f04dc2fcfc70c5003c3d48e7f1722576a18e9ec8.tar.bz2 rneovim-f04dc2fcfc70c5003c3d48e7f1722576a18e9ec8.zip | |
vim-patch:9.2.0408: Insert-mode <Cmd> edits can corrupt undo (#39492)
Problem: A <Cmd> command in Insert mode can edit the current buffer,
e.g., with setline(). That edit appends to the current undo
block, but Insert mode does not know that the cursor line may
need to be saved again before the next typed edit. If the next
typed edit is a <BS> at the start of a line, it can join away
the line that was changed by the <Cmd> command before Insert
mode saves that updated line. The newest undo entry can then
still refer to the joined-away line, so undo sees a range past
the end of the buffer and fails with E438.
Solution: If a <Cmd> command in Insert mode changes the buffer, set
ins_need_undo so stop_arrow() refreshes Insstart. This lets
the next edit properly decide whether a new undo entry is
needed (Jaehwang Jung)
closes: vim/vim#20087
AI-assisted: Codex
https://github.com/vim/vim/commit/e47daed4423182968f64b80c3d7613f0a98a50d4
Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
Diffstat (limited to 'runtime/lua/vim/provider/python.lua')
0 files changed, 0 insertions, 0 deletions