diff src/testdir/test_highlight.vim @ 28269:20b28fbf7f03 v8.2.4660

patch 8.2.4660: cursorcolumn is sometimes not correct Commit: https://github.com/vim/vim/commit/782c6744b49b30d9460ed00d4773666e42e07163 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 1 12:06:31 2022 +0100 patch 8.2.4660: cursorcolumn is sometimes not correct Problem: Cursorcolumn is sometimes not correct. Solution: Recompute the cursor column when entering Insert mode and the cursor is on a character wider than a screen cell.
author Bram Moolenaar <Bram@vim.org>
date Fri, 01 Apr 2022 13:15:08 +0200
parents c99005ffa8c3
children 9849df834f1d
line wrap: on
line diff
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -592,6 +592,28 @@ func Test_cursorline_with_visualmode()
   call delete('Xtest_cursorline_with_visualmode')
 endfunc
 
+func Test_cursorcolumn_insert_on_tab()
+  CheckScreendump
+
+  let lines =<< trim END
+    call setline(1, ['123456789', "a\tb"])
+    set cursorcolumn
+    call cursor(2, 2)
+  END
+  call writefile(lines, 'Xcuc_insert_on_tab')
+
+  let buf = RunVimInTerminal('-S Xcuc_insert_on_tab', #{rows: 8})
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_1', {})
+
+  call term_sendkeys(buf, 'i')
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+
+  call StopVimInTerminal(buf)
+  call delete('Xcuc_insert_on_tab')
+endfunc
+
 func Test_cursorcolumn_callback()
   CheckScreendump
   CheckFeature timers