summaryrefslogtreecommitdiff
path: root/src/testdir/test_matchadd_conceal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-16 14:19:33 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-16 14:19:33 +0100
commit08f23636aef595f4cc061dfee8248dca97df16b3 (patch)
tree90da2416a35ce2c406cca94115f8578e358804c2 /src/testdir/test_matchadd_conceal.vim
parentf4a1d1c0542df151bc59ac3b798ed198b5c71ccc (diff)
downloadvim-git-08f23636aef595f4cc061dfee8248dca97df16b3.tar.gz
patch 8.1.2303: cursor in wrong position after horizontal scrollv8.1.2303
Problem: Cursor in wrong position after horizontal scroll. Solution: Set w_valid_leftcol. (closes #5214, closes #5224)
Diffstat (limited to 'src/testdir/test_matchadd_conceal.vim')
-rw-r--r--src/testdir/test_matchadd_conceal.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_matchadd_conceal.vim b/src/testdir/test_matchadd_conceal.vim
index 83eadce5a..25bff3dea 100644
--- a/src/testdir/test_matchadd_conceal.vim
+++ b/src/testdir/test_matchadd_conceal.vim
@@ -316,3 +316,31 @@ func Test_cursor_column_in_concealed_line_after_window_scroll()
call StopVimInTerminal(buf)
call delete('Xcolesearch')
endfunc
+
+func Test_cursor_column_in_concealed_line_after_leftcol_change()
+ CheckRunVimInTerminal
+
+ " Test for issue #5214 fix.
+ let lines =<< trim END
+ 0put = 'ab' .. repeat('-', &columns) .. 'c'
+ call matchadd('Conceal', '-')
+ set nowrap ss=0 cole=3 cocu=n
+ END
+ call writefile(lines, 'Xcurs-columns')
+ let buf = RunVimInTerminal('-S Xcurs-columns', {})
+
+ " Go to the end of the line (3 columns beyond the end of the screen).
+ " Horizontal scroll would center the cursor in the screen line, but conceal
+ " makes it go to screen column 1.
+ call term_sendkeys(buf, "$")
+ call term_wait(buf)
+
+ " Are the concealed parts of the current line really hidden?
+ call assert_equal('c', term_getline(buf, '.'))
+
+ " BugFix check: Is the window's cursor column properly updated for conceal?
+ call assert_equal(1, term_getcursor(buf)[1])
+
+ call StopVimInTerminal(buf)
+ call delete('Xcurs-columns')
+endfunc