vim-patch:9.1.2037: undo: cursor position not correctly restored (#37195)

Problem:  undo: cursor position not correctly restored
Solution: Do not override the saved cursor position (altermo)

closes: vim/vim#19052

a722da29c1

Co-authored-by: altermo <107814000+altermo@users.noreply.github.com>
This commit is contained in:
zeertzjq
2026-01-02 08:21:55 +08:00
committed by GitHub
parent 94f7302e66
commit acc3554439
3 changed files with 18 additions and 5 deletions

View File

@@ -911,5 +911,16 @@ func Test_load_existing_undofile()
bw!
endfunc
func Test_restore_cursor_position_after_undo()
CheckFeature persistent_undo
sp samples/test_undo.txt
3 | exe "norm! gqk" | undojoin | 1 delete
call assert_equal(1, line('.'))
norm! u
call assert_equal(3, line('.'))
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab