summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_conceal.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_conceal.vim')
-rw-r--r--src/testdir/test_conceal.vim54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index 16953fc32c..7080fdd1f0 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -462,4 +462,58 @@ func Test_conceal_mouse_click()
set mouse& virtualedit&
endfunc
+" Test that cursor is drawn at the correct column when it is after end of the
+" line with 'virtualedit' and concealing.
+func Test_conceal_virtualedit_after_eol()
+ CheckScreendump
+
+ let code =<< trim [CODE]
+ call setline(1, 'abcdefgh|hidden|ijklmnpop')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n virtualedit=all
+ normal! $
+ [CODE]
+ call writefile(code, 'XTest_conceal_ve_after_eol', 'D')
+ let buf = RunVimInTerminal('-S XTest_conceal_ve_after_eol', {'rows': 3})
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_1', {})
+ call term_sendkeys(buf, "l")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_2', {})
+ call term_sendkeys(buf, "l")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_3', {})
+ call term_sendkeys(buf, "l")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_4', {})
+ call term_sendkeys(buf, "rr")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_5', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
+" Same as Test_conceal_virtualedit_after_eol(), but with 'rightleft' set.
+func Test_conceal_virtualedit_after_eol_rightleft()
+ CheckFeature rightleft
+ CheckScreendump
+
+ let code =<< trim [CODE]
+ call setline(1, 'abcdefgh|hidden|ijklmnpop')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n virtualedit=all rightleft
+ normal! $
+ [CODE]
+ call writefile(code, 'XTest_conceal_ve_after_eol_rl', 'D')
+ let buf = RunVimInTerminal('-S XTest_conceal_ve_after_eol_rl', {'rows': 3})
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_1', {})
+ call term_sendkeys(buf, "h")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_2', {})
+ call term_sendkeys(buf, "h")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_3', {})
+ call term_sendkeys(buf, "h")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_4', {})
+ call term_sendkeys(buf, "rr")
+ call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_5', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab