Files
neovim/test
zeertzjq f04dc2fcfc 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

e47daed442

Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
2026-04-29 13:09:55 +08:00
..
2026-04-22 18:25:07 -04:00
2026-04-22 18:25:07 -04:00