diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-03-23 11:30:02 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-24 16:08:59 +0800 |
| commit | 3e9b4e917d0783d0414192c3ad231cfcb813e73f (patch) | |
| tree | 5e95003eea2e5076fa8db2efdcbf3970302a66bc /src/nvim/testdir | |
| parent | a72f338d76c871869712518df862c85d1df25f54 (diff) | |
| download | rneovim-3e9b4e917d0783d0414192c3ad231cfcb813e73f.tar.gz rneovim-3e9b4e917d0783d0414192c3ad231cfcb813e73f.tar.bz2 rneovim-3e9b4e917d0783d0414192c3ad231cfcb813e73f.zip | |
vim-patch:8.2.4591: cursor line not updated when a callback moves the cursor
Problem: Cursor line not updated when a callback moves the cursor.
Solution: Check if the cursor moved. (closes vim/vim#9970)
https://github.com/vim/vim/commit/e7a74d53754765f22ef8ce71c915bb669d5f7f3f
redraw_after_callback() is N/A. Nvim handles timers on the main loop.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_cursorline.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cursorline.vim b/src/nvim/testdir/test_cursorline.vim index 39d8b901ed..bf049ec779 100644 --- a/src/nvim/testdir/test_cursorline.vim +++ b/src/nvim/testdir/test_cursorline.vim @@ -268,4 +268,30 @@ END call delete('Xtextfile') endfunc +func Test_cursorline_callback() + CheckScreendump + CheckFeature timers + + let lines =<< trim END + call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd']) + set cursorline + call cursor(4, 1) + + func Func(timer) + call cursor(2, 1) + endfunc + + call timer_start(300, 'Func') + END + call writefile(lines, 'Xcul_timer') + + let buf = RunVimInTerminal('-S Xcul_timer', #{rows: 8}) + call TermWait(buf, 310) + call VerifyScreenDump(buf, 'Test_cursorline_callback_1', {}) + + call StopVimInTerminal(buf) + call delete('Xcul_timer') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |