mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 9.0.0515: virtual text highlight starts too early when 'number' is set
Problem: Virtual text highlight starts too early when 'number' is set. Solution: Set column offset when wrapping. (issue #11138)
This commit is contained in:
@@ -376,6 +376,9 @@ text_prop_position(
|
|||||||
else
|
else
|
||||||
before = 0;
|
before = 0;
|
||||||
}
|
}
|
||||||
|
else if (below && before > 0)
|
||||||
|
// include 'number' column et al.
|
||||||
|
col_off = win_col_off(wp) + win_col_off2(wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// With 'nowrap' add one to show the "extends" character if needed (it
|
// With 'nowrap' add one to show the "extends" character if needed (it
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @63
|
|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @63
|
||||||
|t|w|o| |t|w|o| |t|w|o| @63
|
|t|w|o| |t|w|o| |t|w|o| @63
|
||||||
@3|└+2&&|─| |V|i|r|t|u|a|l| |t|e|x|t| |b|e|l|o|w| |t|h|e| |2|n|d| |l|i|n|e| +0&&@37
|
@3|└+0&#ffff4012|─| |V|i|r|t|u|a|l| |t|e|x|t| |b|e|l|o|w| |t|h|e| |2|n|d| |l|i|n|e| +0&#ffffff0@37
|
||||||
|x@1> @72
|
|x@1> @72
|
||||||
|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @57
|
|t|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @57
|
||||||
|~+0#4040ff13&| @73
|
|~+0#4040ff13&| @73
|
||||||
|
8
src/testdir/dumps/Test_prop_below_split_line_2.dump
Normal file
8
src/testdir/dumps/Test_prop_below_split_line_2.dump
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |o|n|e| |o|n|e| @59
|
||||||
|
| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |t|w|o| |t|w|o| @59
|
||||||
|
| +0#af5f00255&@3| +0#0000000&@2|└+0&#ffff4012|─| |V|i|r|t|u|a|l| |t|e|x|t| |b|e|l|o|w| |t|h|e| |2|n|d| |l|i|n|e| +0&#ffffff0@33
|
||||||
|
| +0#af5f00255&@1|3| |x+0#0000000&>x| @68
|
||||||
|
| +0#af5f00255&@1|4| |t+0#0000000&|h|r|e@1| |t|h|r|e@1| |t|h|r|e@1| @53
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|:+0#0000000&|s|e|t| |n|u|m|b|e|r| @45|3|,|2| @10|A|l@1|
|
@@ -1231,13 +1231,12 @@ func Test_textprop_screenshot_various()
|
|||||||
\ "normal 6G0i\<BS>\<Esc>",
|
\ "normal 6G0i\<BS>\<Esc>",
|
||||||
\ "normal 3J",
|
\ "normal 3J",
|
||||||
\ "normal 3G",
|
\ "normal 3G",
|
||||||
\], 'XtestProp')
|
\], 'XtestProp', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestProp', {'rows': 8})
|
let buf = RunVimInTerminal('-S XtestProp', {'rows': 8})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_01', {})
|
call VerifyScreenDump(buf, 'Test_textprop_01', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestProp')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_textprop_hl_override()
|
func Test_textprop_hl_override()
|
||||||
@@ -1259,7 +1258,7 @@ func Test_textprop_hl_override()
|
|||||||
set cursorline
|
set cursorline
|
||||||
2
|
2
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestOverProp')
|
call writefile(lines, 'XtestOverProp', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestOverProp', {'rows': 8})
|
let buf = RunVimInTerminal('-S XtestOverProp', {'rows': 8})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_hl_override_1', {})
|
call VerifyScreenDump(buf, 'Test_textprop_hl_override_1', {})
|
||||||
|
|
||||||
@@ -1269,7 +1268,6 @@ func Test_textprop_hl_override()
|
|||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestOverProp')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func RunTestVisualBlock(width, dump)
|
func RunTestVisualBlock(width, dump)
|
||||||
@@ -1299,13 +1297,12 @@ func RunTestVisualBlock(width, dump)
|
|||||||
\ "call prop_add(9, 3, {'length': 3, 'type': 'search'})",
|
\ "call prop_add(9, 3, {'length': 3, 'type': 'search'})",
|
||||||
\ "call prop_add(10, 2, {'length': 3, 'type': 'search'})",
|
\ "call prop_add(10, 2, {'length': 3, 'type': 'search'})",
|
||||||
\ "normal 1G6|\<C-V>" .. repeat('l', a:width - 1) .. "10jx",
|
\ "normal 1G6|\<C-V>" .. repeat('l', a:width - 1) .. "10jx",
|
||||||
\], 'XtestPropVis')
|
\], 'XtestPropVis', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestPropVis', {'rows': 12})
|
let buf = RunVimInTerminal('-S XtestPropVis', {'rows': 12})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_vis_' .. a:dump, {})
|
call VerifyScreenDump(buf, 'Test_textprop_vis_' .. a:dump, {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestPropVis')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" screenshot test with Visual block mode operations
|
" screenshot test with Visual block mode operations
|
||||||
@@ -1332,13 +1329,12 @@ func Test_textprop_after_tab()
|
|||||||
call prop_add(1, 2, {'length': 3, 'type': 'search'})
|
call prop_add(1, 2, {'length': 3, 'type': 'search'})
|
||||||
call prop_add(2, 3, {'length': 3, 'type': 'search'})
|
call prop_add(2, 3, {'length': 3, 'type': 'search'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestPropTab')
|
call writefile(lines, 'XtestPropTab', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestPropTab', {'rows': 6})
|
let buf = RunVimInTerminal('-S XtestPropTab', {'rows': 6})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_tab', {})
|
call VerifyScreenDump(buf, 'Test_textprop_tab', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestPropTab')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_textprop_nowrap_scrolled()
|
func Test_textprop_nowrap_scrolled()
|
||||||
@@ -1353,7 +1349,7 @@ func Test_textprop_nowrap_scrolled()
|
|||||||
prop_add(1, 32, {'length': 4, 'type': 'number'})
|
prop_add(1, 32, {'length': 4, 'type': 'number'})
|
||||||
feedkeys('gg20zl', 'nxt')
|
feedkeys('gg20zl', 'nxt')
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestNowrap')
|
call writefile(lines, 'XtestNowrap', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestNowrap', {'rows': 6})
|
let buf = RunVimInTerminal('-S XtestNowrap', {'rows': 6})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_nowrap_01', {})
|
call VerifyScreenDump(buf, 'Test_textprop_nowrap_01', {})
|
||||||
|
|
||||||
@@ -1362,7 +1358,6 @@ func Test_textprop_nowrap_scrolled()
|
|||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestNowrap')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_textprop_text_priority()
|
func Test_textprop_text_priority()
|
||||||
@@ -1383,13 +1378,12 @@ func Test_textprop_text_priority()
|
|||||||
call prop_add(1, 17, #{type: 'two', text: 'two: '})
|
call prop_add(1, 17, #{type: 'two', text: 'two: '})
|
||||||
call prop_add(1, 17, #{type: 'arg', length: len('argument')})
|
call prop_add(1, 17, #{type: 'arg', length: len('argument')})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestPropPrio')
|
call writefile(lines, 'XtestPropPrio', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestPropPrio', {'rows': 5})
|
let buf = RunVimInTerminal('-S XtestPropPrio', {'rows': 5})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_at_same_pos', {})
|
call VerifyScreenDump(buf, 'Test_prop_at_same_pos', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestPropPrio')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_textprop_with_syntax()
|
func Test_textprop_with_syntax()
|
||||||
@@ -1405,13 +1399,12 @@ func Test_textprop_with_syntax()
|
|||||||
call prop_type_add('TPTitle', #{ highlight: 'Title' })
|
call prop_type_add('TPTitle', #{ highlight: 'Title' })
|
||||||
call prop_add(1, 2, #{type: 'TPTitle', end_col: 5})
|
call prop_add(1, 2, #{type: 'TPTitle', end_col: 5})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestPropSyn')
|
call writefile(lines, 'XtestPropSyn', 'D')
|
||||||
let buf = RunVimInTerminal('-S XtestPropSyn', {'rows': 6})
|
let buf = RunVimInTerminal('-S XtestPropSyn', {'rows': 6})
|
||||||
call VerifyScreenDump(buf, 'Test_textprop_syn_1', {})
|
call VerifyScreenDump(buf, 'Test_textprop_syn_1', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestPropSyn')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Adding a text property to a new buffer should not fail
|
" Adding a text property to a new buffer should not fail
|
||||||
@@ -1934,7 +1927,7 @@ func Test_prop_in_linebreak()
|
|||||||
set signcolumn=yes
|
set signcolumn=yes
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropLinebreak')
|
call writefile(lines, 'XscriptPropLinebreak', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropLinebreak', #{rows: 10})
|
let buf = RunVimInTerminal('-S XscriptPropLinebreak', #{rows: 10})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_linebreak_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_linebreak_1', {})
|
||||||
|
|
||||||
@@ -1942,7 +1935,6 @@ func Test_prop_in_linebreak()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_linebreak_2', {})
|
call VerifyScreenDump(buf, 'Test_prop_linebreak_2', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropLinebreak')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_with_linebreak()
|
func Test_prop_with_linebreak()
|
||||||
@@ -1955,14 +1947,13 @@ func Test_prop_with_linebreak()
|
|||||||
prop_type_add('test', {highlight: 'Special'})
|
prop_type_add('test', {highlight: 'Special'})
|
||||||
prop_add(1, 4, {text: ': virtual text', type: 'test', text_wrap: 'wrap'})
|
prop_add(1, 4, {text: ': virtual text', type: 'test', text_wrap: 'wrap'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropWithLinebreak')
|
call writefile(lines, 'XscriptPropWithLinebreak', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropWithLinebreak', #{rows: 6, cols: 50})
|
let buf = RunVimInTerminal('-S XscriptPropWithLinebreak', #{rows: 6, cols: 50})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_linebreak_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_linebreak_1', {})
|
||||||
call term_sendkeys(buf, "iasdf asdf asdf asdf asdf as\<Esc>")
|
call term_sendkeys(buf, "iasdf asdf asdf asdf asdf as\<Esc>")
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_linebreak_2', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_linebreak_2', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropWithLinebreak')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_with_wrap()
|
func Test_prop_with_wrap()
|
||||||
@@ -1975,12 +1966,11 @@ func Test_prop_with_wrap()
|
|||||||
prop_type_add('test', {highlight: 'Special'})
|
prop_type_add('test', {highlight: 'Special'})
|
||||||
prop_add(1, 43, {text: 'some virtual text', type: 'test'})
|
prop_add(1, 43, {text: 'some virtual text', type: 'test'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropWithWrap')
|
call writefile(lines, 'XscriptPropWithWrap', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropWithWrap', #{rows: 6, cols: 50})
|
let buf = RunVimInTerminal('-S XscriptPropWithWrap', #{rows: 6, cols: 50})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_wrap_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_wrap_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropWithWrap')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_after_tab()
|
func Test_prop_after_tab()
|
||||||
@@ -1992,12 +1982,11 @@ func Test_prop_after_tab()
|
|||||||
call prop_type_add('test', #{highlight: 'ErrorMsg'})
|
call prop_type_add('test', #{highlight: 'ErrorMsg'})
|
||||||
call prop_add(1, 2, #{length: 1, type: 'test'})
|
call prop_add(1, 2, #{length: 1, type: 'test'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropAfterTab')
|
call writefile(lines, 'XscriptPropAfterTab', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropAfterTab', #{rows: 10})
|
let buf = RunVimInTerminal('-S XscriptPropAfterTab', #{rows: 10})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_after_tab', {})
|
call VerifyScreenDump(buf, 'Test_prop_after_tab', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropAfterTab')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_before_tab()
|
func Test_prop_before_tab()
|
||||||
@@ -2014,7 +2003,7 @@ func Test_prop_before_tab()
|
|||||||
call prop_add(6, 3, #{type: 'test', text: 'ABC'})
|
call prop_add(6, 3, #{type: 'test', text: 'ABC'})
|
||||||
normal gg0
|
normal gg0
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropBeforeTab')
|
call writefile(lines, 'XscriptPropBeforeTab', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropBeforeTab', #{rows: 8})
|
let buf = RunVimInTerminal('-S XscriptPropBeforeTab', #{rows: 8})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_before_tab_01', {})
|
call VerifyScreenDump(buf, 'Test_prop_before_tab_01', {})
|
||||||
call term_sendkeys(buf, "$")
|
call term_sendkeys(buf, "$")
|
||||||
@@ -2037,7 +2026,6 @@ func Test_prop_before_tab()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_before_tab_10', {})
|
call VerifyScreenDump(buf, 'Test_prop_before_tab_10', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropBeforeTab')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_after_linebreak()
|
func Test_prop_after_linebreak()
|
||||||
@@ -2049,12 +2037,11 @@ func Test_prop_after_linebreak()
|
|||||||
call prop_type_add('test', #{highlight: 'ErrorMsg'})
|
call prop_type_add('test', #{highlight: 'ErrorMsg'})
|
||||||
call prop_add(1, (&columns / 2) + 2, #{length: 1, type: 'test'})
|
call prop_add(1, (&columns / 2) + 2, #{length: 1, type: 'test'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropAfterLinebreak')
|
call writefile(lines, 'XscriptPropAfterLinebreak', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropAfterLinebreak', #{rows: 10})
|
let buf = RunVimInTerminal('-S XscriptPropAfterLinebreak', #{rows: 10})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_after_linebreak', {})
|
call VerifyScreenDump(buf, 'Test_prop_after_linebreak', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropAfterLinebreak')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Buffer number of 0 should be ignored, as if the parameter wasn't passed.
|
" Buffer number of 0 should be ignored, as if the parameter wasn't passed.
|
||||||
@@ -2520,7 +2507,7 @@ func Test_prop_inserts_text()
|
|||||||
call prop_type_add('nohi', #{})
|
call prop_type_add('nohi', #{})
|
||||||
call prop_add(5, 6, #{type: 'nohi', text: 'no '})
|
call prop_add(5, 6, #{type: 'nohi', text: 'no '})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithText')
|
call writefile(lines, 'XscriptPropsWithText', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_inserts_text_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_inserts_text_1', {})
|
||||||
|
|
||||||
@@ -2539,7 +2526,6 @@ func Test_prop_inserts_text()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_inserts_text_6', {})
|
call VerifyScreenDump(buf, 'Test_prop_inserts_text_6', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithText')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_inserts_text_highlight()
|
func Test_prop_inserts_text_highlight()
|
||||||
@@ -2559,7 +2545,7 @@ func Test_prop_inserts_text_highlight()
|
|||||||
let @/ = ''
|
let @/ = ''
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithHighlight')
|
call writefile(lines, 'XscriptPropsWithHighlight', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithHighlight', #{rows: 6, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithHighlight', #{rows: 6, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_1', {})
|
||||||
call term_sendkeys(buf, "/text (he\<CR>")
|
call term_sendkeys(buf, "/text (he\<CR>")
|
||||||
@@ -2575,7 +2561,6 @@ func Test_prop_inserts_text_highlight()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_6', {})
|
call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_6', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithHighlight')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_prop_add_with_text_fails()
|
func Test_prop_add_with_text_fails()
|
||||||
@@ -2599,7 +2584,7 @@ func Test_props_with_text_right_align_twice()
|
|||||||
call prop_add(1, 0, #{type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right'})
|
call prop_add(1, 0, #{type: 'MyErrorText', text: 'Another error', text_wrap: 'wrap', text_align: 'right'})
|
||||||
normal G$
|
normal G$
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsRightAlign')
|
call writefile(lines, 'XscriptPropsRightAlign', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsRightAlign', #{rows: 8})
|
let buf = RunVimInTerminal('-S XscriptPropsRightAlign', #{rows: 8})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_1', {})
|
||||||
|
|
||||||
@@ -2610,7 +2595,6 @@ func Test_props_with_text_right_align_twice()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_3', {})
|
call VerifyScreenDump(buf, 'Test_prop_right_align_twice_3', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsRightAlign')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after()
|
func Test_props_with_text_after()
|
||||||
@@ -2635,12 +2619,11 @@ func Test_props_with_text_after()
|
|||||||
call setline(3, 'right here')
|
call setline(3, 'right here')
|
||||||
call prop_add(3, 0, #{type: 'rightprop', text: 'söme和平téxt', text_align: 'right'})
|
call prop_add(3, 0, #{type: 'rightprop', text: 'söme和平téxt', text_align: 'right'})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithTextAfter')
|
call writefile(lines, 'XscriptPropsWithTextAfter', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithTextAfter')
|
|
||||||
|
|
||||||
call assert_fails('call prop_add(1, 2, #{text: "yes", text_align: "right", type: "some"})', 'E1294:')
|
call assert_fails('call prop_add(1, 2, #{text: "yes", text_align: "right", type: "some"})', 'E1294:')
|
||||||
endfunc
|
endfunc
|
||||||
@@ -2666,12 +2649,11 @@ func Test_props_with_text_after_below_trunc()
|
|||||||
})
|
})
|
||||||
normal G$
|
normal G$
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsAfterTrunc')
|
call writefile(lines, 'XscriptPropsAfterTrunc', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsAfterTrunc', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsAfterTrunc', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsAfterTrunc')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after_joined()
|
func Test_props_with_text_after_joined()
|
||||||
@@ -2692,12 +2674,11 @@ func Test_props_with_text_after_joined()
|
|||||||
call prop_add(8, 0, #{type: 'afterprop', text: ' FFF', text_align: 'after'})
|
call prop_add(8, 0, #{type: 'afterprop', text: ' FFF', text_align: 'after'})
|
||||||
normal 3G6J
|
normal 3G6J
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithTextAfterJoined')
|
call writefile(lines, 'XscriptPropsWithTextAfterJoined', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterJoined', #{rows: 6, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterJoined', #{rows: 6, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_joined_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_joined_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithTextAfterJoined')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after_truncated()
|
func Test_props_with_text_after_truncated()
|
||||||
@@ -2717,7 +2698,7 @@ func Test_props_with_text_after_truncated()
|
|||||||
call setline(4, ['cursor here'])
|
call setline(4, ['cursor here'])
|
||||||
normal 4Gfh
|
normal 4Gfh
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithTextAfterTrunc')
|
call writefile(lines, 'XscriptPropsWithTextAfterTrunc', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterTrunc', #{rows: 9, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterTrunc', #{rows: 9, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_trunc_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_trunc_1', {})
|
||||||
|
|
||||||
@@ -2736,7 +2717,6 @@ func Test_props_with_text_after_truncated()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_trunc_5', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_trunc_5', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithTextAfterTrunc')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_empty_line()
|
func Test_props_with_text_empty_line()
|
||||||
@@ -2749,7 +2729,7 @@ func Test_props_with_text_empty_line()
|
|||||||
call prop_add(3, 1, #{type: 'prop1', text_wrap: 'wrap', text: repeat('X', &columns + 1)})
|
call prop_add(3, 1, #{type: 'prop1', text_wrap: 'wrap', text: repeat('X', &columns + 1)})
|
||||||
normal gg0
|
normal gg0
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithTextEmptyLine')
|
call writefile(lines, 'XscriptPropsWithTextEmptyLine', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithTextEmptyLine', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithTextEmptyLine', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_1', {})
|
||||||
call term_sendkeys(buf, "$")
|
call term_sendkeys(buf, "$")
|
||||||
@@ -2762,7 +2742,6 @@ func Test_props_with_text_empty_line()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_5', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_empty_line_5', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithTextEmptyLine')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after_wraps()
|
func Test_props_with_text_after_wraps()
|
||||||
@@ -2782,12 +2761,11 @@ func Test_props_with_text_after_wraps()
|
|||||||
call setline(4, ['cursor here'])
|
call setline(4, ['cursor here'])
|
||||||
normal 4Gfh
|
normal 4Gfh
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsWithTextAfterWraps')
|
call writefile(lines, 'XscriptPropsWithTextAfterWraps', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterWraps', #{rows: 9, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfterWraps', #{rows: 9, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_wraps_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_wraps_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsWithTextAfterWraps')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after_nowrap()
|
func Test_props_with_text_after_nowrap()
|
||||||
@@ -2810,7 +2788,7 @@ func Test_props_with_text_after_nowrap()
|
|||||||
call prop_add(3, 0, #{type: 'anotherprop', text: 'also right aligned', text_align: 'right'})
|
call prop_add(3, 0, #{type: 'anotherprop', text: 'also right aligned', text_align: 'right'})
|
||||||
hi CursorLine ctermbg=lightgrey
|
hi CursorLine ctermbg=lightgrey
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsAfterNowrap')
|
call writefile(lines, 'XscriptPropsAfterNowrap', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsAfterNowrap', #{rows: 12, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsAfterNowrap', #{rows: 12, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_1', {})
|
||||||
|
|
||||||
@@ -2821,7 +2799,6 @@ func Test_props_with_text_after_nowrap()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_3', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_nowrap_3', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsAfterNowrap')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_below_nowrap()
|
func Test_props_with_text_below_nowrap()
|
||||||
@@ -2846,7 +2823,7 @@ func Test_props_with_text_below_nowrap()
|
|||||||
})
|
})
|
||||||
normal G$
|
normal G$
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsBelowNowrap')
|
call writefile(lines, 'XscriptPropsBelowNowrap', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsBelowNowrap', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsBelowNowrap', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_1', {})
|
||||||
|
|
||||||
@@ -2854,7 +2831,6 @@ func Test_props_with_text_below_nowrap()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_2', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_2', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsBelowNowrap')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_above()
|
func Test_props_with_text_above()
|
||||||
@@ -2933,7 +2909,7 @@ func Test_prop_below_split_line()
|
|||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
setline(1, ['one one one', 'two two two', 'three three three'])
|
setline(1, ['one one one', 'two two two', 'three three three'])
|
||||||
prop_type_add('test', {highlight: 'ModeMsg'})
|
prop_type_add('test', {highlight: 'Search'})
|
||||||
prop_add(2, 0, {
|
prop_add(2, 0, {
|
||||||
text: '└─ Virtual text below the 2nd line',
|
text: '└─ Virtual text below the 2nd line',
|
||||||
type: 'test',
|
type: 'test',
|
||||||
@@ -2946,7 +2922,9 @@ func Test_prop_below_split_line()
|
|||||||
call term_sendkeys(buf, "2GA\<CR>xx")
|
call term_sendkeys(buf, "2GA\<CR>xx")
|
||||||
call VerifyScreenDump(buf, 'Test_prop_below_split_line_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_below_split_line_1', {})
|
||||||
|
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>:set number\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_prop_below_split_line_2', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -2996,7 +2974,7 @@ func Test_props_with_text_CursorMoved()
|
|||||||
|
|
||||||
autocmd CursorMoved * call Update()
|
autocmd CursorMoved * call Update()
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsCursorMovec')
|
call writefile(lines, 'XscriptPropsCursorMovec', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsCursorMovec', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsCursorMovec', #{rows: 8, cols: 60})
|
||||||
call term_sendkeys(buf, "gg0w")
|
call term_sendkeys(buf, "gg0w")
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_cursormoved_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_cursormoved_1', {})
|
||||||
@@ -3009,7 +2987,6 @@ func Test_props_with_text_CursorMoved()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_cursormoved_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_cursormoved_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsCursorMovec')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_props_with_text_after_split_join()
|
func Test_props_with_text_after_split_join()
|
||||||
@@ -3027,7 +3004,7 @@ func Test_props_with_text_after_split_join()
|
|||||||
call prop_add(1, 0, #{type: 'another', text: ' right here', text_align: 'right'})
|
call prop_add(1, 0, #{type: 'another', text: ' right here', text_align: 'right'})
|
||||||
endfunc
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsAfterSplitJoin')
|
call writefile(lines, 'XscriptPropsAfterSplitJoin', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsAfterSplitJoin', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsAfterSplitJoin', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_join_split_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_join_split_1', {})
|
||||||
|
|
||||||
@@ -3044,7 +3021,6 @@ func Test_props_with_text_after_split_join()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_with_text_after_join_split_5', {})
|
call VerifyScreenDump(buf, 'Test_prop_with_text_after_join_split_5', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsAfterSplitJoin')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_removed_prop_with_text_cleans_up_array()
|
func Test_removed_prop_with_text_cleans_up_array()
|
||||||
@@ -3099,7 +3075,7 @@ func Test_insert_text_start_incl()
|
|||||||
prop_type_add('argname', {highlight: 'DiffChange', start_incl: true})
|
prop_type_add('argname', {highlight: 'DiffChange', start_incl: true})
|
||||||
prop_add(3, 10, {type: 'argname', text: 'arg: '})
|
prop_add(3, 10, {type: 'argname', text: 'arg: '})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsStartIncl')
|
call writefile(lines, 'XscriptPropsStartIncl', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsStartIncl', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_1', {})
|
||||||
|
|
||||||
@@ -3121,7 +3097,6 @@ func Test_insert_text_start_incl()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_8', {})
|
call VerifyScreenDump(buf, 'Test_prop_insert_start_incl_8', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsStartIncl')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_insert_text_list_mode()
|
func Test_insert_text_list_mode()
|
||||||
@@ -3139,7 +3114,7 @@ func Test_insert_text_list_mode()
|
|||||||
text_align: 'right'
|
text_align: 'right'
|
||||||
})
|
})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsListMode')
|
call writefile(lines, 'XscriptPropsListMode', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsListMode', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsListMode', #{rows: 8, cols: 60})
|
||||||
call term_sendkeys(buf, "ggj")
|
call term_sendkeys(buf, "ggj")
|
||||||
call VerifyScreenDump(buf, 'Test_prop_insert_list_mode_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_insert_list_mode_1', {})
|
||||||
@@ -3151,7 +3126,6 @@ func Test_insert_text_list_mode()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_insert_list_mode_3', {})
|
call VerifyScreenDump(buf, 'Test_prop_insert_list_mode_3', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsListMode')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_insert_text_with_padding()
|
func Test_insert_text_with_padding()
|
||||||
@@ -3189,7 +3163,7 @@ func Test_insert_text_with_padding()
|
|||||||
text_wrap: 'wrap',
|
text_wrap: 'wrap',
|
||||||
})
|
})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsPadded')
|
call writefile(lines, 'XscriptPropsPadded', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsPadded', #{rows: 8, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsPadded', #{rows: 8, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_text_with_padding_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_text_with_padding_1', {})
|
||||||
|
|
||||||
@@ -3204,7 +3178,6 @@ func Test_insert_text_with_padding()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_text_with_padding_4', {})
|
call VerifyScreenDump(buf, 'Test_prop_text_with_padding_4', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsPadded')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_insert_text_change_arg()
|
func Test_insert_text_change_arg()
|
||||||
@@ -3232,7 +3205,7 @@ func Test_insert_text_change_arg()
|
|||||||
text: '-',
|
text: '-',
|
||||||
})
|
})
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptPropsChange')
|
call writefile(lines, 'XscriptPropsChange', 'D')
|
||||||
let buf = RunVimInTerminal('-S XscriptPropsChange', #{rows: 5, cols: 60})
|
let buf = RunVimInTerminal('-S XscriptPropsChange', #{rows: 5, cols: 60})
|
||||||
call VerifyScreenDump(buf, 'Test_prop_text_change_arg_1', {})
|
call VerifyScreenDump(buf, 'Test_prop_text_change_arg_1', {})
|
||||||
|
|
||||||
@@ -3240,7 +3213,6 @@ func Test_insert_text_change_arg()
|
|||||||
call VerifyScreenDump(buf, 'Test_prop_text_change_arg_2', {})
|
call VerifyScreenDump(buf, 'Test_prop_text_change_arg_2', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptPropsChange')
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
515,
|
||||||
/**/
|
/**/
|
||||||
514,
|
514,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user