summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_textprop.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-27 19:04:14 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-27 19:04:14 +0200
commit6a3897232aecd3e8b9e8b23955e55c1993e5baec (patch)
tree8a24311230d8c60a43290b5bcaed2080ba31af6a /src/testdir/test_textprop.vim
parent9a6cf34a1ebdd258acbc6f186bffed42cec2c1a0 (diff)
patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual textv9.0.1800
Problem: Cursor position still wrong with 'showbreak' and virtual text after last character or 'listchars' "eol". Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also fix first char of virtual text not shown at the start of a screen line. closes: #12478 closes: #12532 closes: #12904 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r--src/testdir/test_textprop.vim35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 93baa7a7ed..f258c19f41 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2686,11 +2686,11 @@ func Run_test_prop_inserts_text_showbreak(cmd)
let lines =<< trim END
highlight! link LineNr Normal
+ setlocal number showbreak=+ breakindent breakindentopt=shift:2
+ setlocal scrolloff=0 smoothscroll
call setline(1, repeat('a', 28))
call prop_type_add('theprop', #{highlight: 'Special'})
call prop_add(1, 28, #{type: 'theprop', text: repeat('123', 23), text_wrap: 'wrap'})
- setlocal number showbreak=+ breakindent breakindentopt=shift:2
- setlocal scrolloff=0 smoothscroll
normal! $
END
let lines = insert(lines, a:cmd)
@@ -2740,6 +2740,10 @@ func Run_test_prop_inserts_text_showbreak(cmd)
call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_21', {})
call term_sendkeys(buf, "zbx")
call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_22', {})
+ call term_sendkeys(buf, "26ia\<Esc>a")
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_23', {})
+ call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal breakindentopt=\<CR>")
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_24', {})
call StopVimInTerminal(buf)
endfunc
@@ -2754,10 +2758,10 @@ func Test_prop_before_tab_skipcol()
CheckRunVimInTerminal
let lines =<< trim END
+ setlocal list listchars=tab:<-> scrolloff=0 smoothscroll
call setline(1, repeat("\t", 4) .. 'a')
call prop_type_add('theprop', #{highlight: 'Special'})
call prop_add(1, 4, #{type: 'theprop', text: repeat('12', 32), text_wrap: 'wrap'})
- setlocal list listchars=tab:<-> scrolloff=0 smoothscroll
normal! $
END
call writefile(lines, 'XscriptPropsBeforeTabSkipcol', 'D')
@@ -2787,6 +2791,31 @@ func Test_prop_before_tab_skipcol()
call StopVimInTerminal(buf)
endfunc
+func Test_prop_inserts_text_lcs_extends()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ setlocal nowrap list listchars=extends:!
+ call setline(1, repeat('a', &columns + 1))
+ call prop_type_add('theprop', #{highlight: 'Special'})
+ call prop_add(1, &columns + 2, #{type: 'theprop', text: 'bbb'})
+ END
+ call writefile(lines, 'XscriptPropsListExtends', 'D')
+ let buf = RunVimInTerminal('-S XscriptPropsListExtends', #{rows: 3, cols: 50})
+ call term_sendkeys(buf, '20l')
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_lcs_extends_1', {})
+ call term_sendkeys(buf, 'zl')
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_lcs_extends_2', {})
+ call term_sendkeys(buf, 'zl')
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_lcs_extends_3', {})
+ call term_sendkeys(buf, 'zl')
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_lcs_extends_4', {})
+ call term_sendkeys(buf, 'zl')
+ call VerifyScreenDump(buf, 'Test_prop_inserts_text_lcs_extends_5', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_prop_add_with_text_fails()
call prop_type_add('failing', #{highlight: 'ErrorMsg'})
call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_lnum: 1})", 'E1305:')