mirror of
https://github.com/neovim/neovim.git
synced 2026-08-18 05:12:33 +00:00
vim-patch:9.2.0938: cursorbind: cursor in the other window is not updated after undo (#41282)
Problem: In diff mode with 'cursorbind' the cursor in the other window is
not updated after an undo that changes which lines correspond.
Solution: Also check whether the text changed before skipping the update
(Hirohito Higashi).
fixes: vim/vim#20982
related: vim/vim#13219
related: vim/vim#13210
closes: vim/vim#21004
2045a20d4b
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3391,4 +3391,29 @@ func Test_diffput_to_empty_buf()
|
||||
call term_sendkeys(buf, 'j')
|
||||
call VerifyScreenDump(buf, 'Test_diffput_to_empty_buf_03', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Undo can change which lines correspond in a diff. 'cursorbind' must update
|
||||
" the other window even when the cursor here did not move.
|
||||
func Test_diff_cursorbind_after_undo()
|
||||
call setline(1, ['x', 'y', 'c', 'd'])
|
||||
let w1 = win_getid()
|
||||
new
|
||||
call setline(1, ['p', 'q', 'c', 'd'])
|
||||
let w2 = win_getid()
|
||||
windo diffthis
|
||||
call win_gotoid(w1)
|
||||
|
||||
normal! 2dd
|
||||
call assert_equal(1, line('.', w1))
|
||||
call assert_equal(1, line('.', w2))
|
||||
normal! jk
|
||||
call assert_equal(1, line('.', w1))
|
||||
call assert_equal(3, line('.', w2))
|
||||
|
||||
normal! u
|
||||
call assert_equal(1, line('.', w1))
|
||||
call assert_equal(1, line('.', w2))
|
||||
|
||||
%bw!
|
||||
|
||||
Reference in New Issue
Block a user