diff src/testdir/test_cursorline.vim @ 28133:373f1afadfa3 v8.2.4591

patch 8.2.4591: cursor line not updated when a callback moves the cursor Commit: https://github.com/vim/vim/commit/e7a74d53754765f22ef8ce71c915bb669d5f7f3f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 19 11:10:15 2022 +0000 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 https://github.com/vim/vim/issues/9970)
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Mar 2022 12:15:04 +0100
parents 95d6e3c9aa1e
children b4c111ea83b1
line wrap: on
line diff
--- a/src/testdir/test_cursorline.vim
+++ b/src/testdir/test_cursorline.vim
@@ -247,4 +247,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