vim9script
&signcolumn = 'yes'
&showbreak = '++'
- &breakindent = true
&breakindentopt = 'shift:2'
var leftcol: number = win_getid()->getwininfo()->get(0, {})->get('textoff')
repeat('x', &columns - leftcol - 1)->setline(1)
" No line wraps, so changing 'showbreak' should lead to the same screen.
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal showbreak=+\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
+ " No line wraps, so setting 'breakindent' should lead to the same screen.
+ call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal breakindent\<CR>")
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
" The first line now wraps because of "eol" in 'listchars'.
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal list\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_2', {})
+ call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal nobreakindent\<CR>")
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_3', {})
call StopVimInTerminal(buf)
endfunc
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)
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
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')
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:')