diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-04-01 12:06:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-01 12:06:31 +0100 |
commit | 782c6744b49b30d9460ed00d4773666e42e07163 (patch) | |
tree | bf703612f9646593492f7dbc275896791095d39e /src/testdir/test_highlight.vim | |
parent | 96e08e028cbcda23dccf83de6b71b3c6bf1f9d4a (diff) | |
download | vim-git-782c6744b49b30d9460ed00d4773666e42e07163.tar.gz |
patch 8.2.4660: cursorcolumn is sometimes not correctv8.2.4660
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.
Diffstat (limited to 'src/testdir/test_highlight.vim')
-rw-r--r-- | src/testdir/test_highlight.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index b07ba1174..4b8cd86fa 100644 --- 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 |