patch 9.1.1798: Wrong display with 'sms' and long wrapped virt text at EOL

Problem:  Wrong display with 'smoothscroll' and long wrapped virtual
          text at EOL.
Solution: Handle w_skipcol inside long wrapped virtual text at EOL
          (zeertzjq).

closes: #18408

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-09-27 12:18:38 +00:00
committed by Christian Brabandt
parent 4edaf89233
commit d9318acc02
25 changed files with 245 additions and 1 deletions

View File

@ -1769,12 +1769,14 @@ win_line(
init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, ptr);
cts.cts_max_head_vcol = v;
while (cts.cts_vcol < v && *cts.cts_ptr != NUL)
while (cts.cts_vcol < v)
{
head = 0;
charsize = win_lbr_chartabsize(&cts, &head);
cts.cts_vcol += charsize;
prev_ptr = cts.cts_ptr;
if (*prev_ptr == NUL)
break;
MB_PTR_ADV(cts.cts_ptr);
if (wp->w_p_list)
{

View File

@ -0,0 +1,8 @@
|0+0&#ffffff0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9
|>+0#4040ff13&| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002| +0#0000000#ffffff0@46
|f|o@1| @46
|b+8&&|a>r| @46
| +0&&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002| +0#0000000#ffffff0@46
|f|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002| +0#0000000#ffffff0@46
|f|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002| +0#0000000#ffffff0@46
|f|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002| +0#0000000#ffffff0@46
|f|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|B|o|t|

View File

@ -0,0 +1,8 @@
|0+0&#ffffff0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|x+0#ffffff16#e000002
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|f+0#0000000#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|f+0#0000000#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|f+0#0000000#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|f+0#0000000#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1| @46
|b+8&&|a>r| @46
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|B|o|t|

View File

@ -0,0 +1,8 @@
|0+0&#ffffff0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|x+0#ffffff16#e000002
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |$| +0#0000000&@46
|f|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
| +0&&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |$| +0#0000000&@46
|f|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |$| +0#0000000&@46
|f|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |$| +0#0000000&@46
|f|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |$| +0#0000000&@46
|f|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|B|o|t|

View File

@ -0,0 +1,8 @@
|0+0&#ffffff0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|x+0#ffffff16#e000002@1
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@46|$+0#4040ff13#ffffff0
|f+0#0000000&|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@46|$+0#4040ff13#ffffff0
|f+0#0000000&|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@47
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@46|$+0#4040ff13#ffffff0
|f+0#0000000&|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|>+0#4040ff13#ffffff0| |x+0#ffffff16#e000002@46|$+0#4040ff13#ffffff0
|f+0#0000000&|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|A|l@1|

View File

@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1|$+0#4040ff13&| +0#0000000&@45
|b+8&&|a>r|$+8#4040ff13&| +8#0000000&@45
|~+0#4040ff13&| @48
|~| @48
|~| @48
|~| @48
|~| @48
| +0#0000000&@31|3|,|3| @10|B|o|t|

View File

@ -4339,6 +4339,70 @@ func Test_text_after_wrap_showbreak()
call StopVimInTerminal(buf)
endfunc
func Test_text_eol_long_wrap_smoothscroll()
CheckScreendump
CheckRunVimInTerminal
let lines =<< trim END
call setline(1, [repeat('0123456789', 5), 'foo', 'bar'])
normal! G$
call prop_type_add('Test', #{highlight: 'ErrorMsg'})
call prop_add(1, 51, #{type: 'Test', text: repeat('x', 145), text_wrap: 'wrap'})
set cursorline scrolloff=0 showbreak=>\ smoothscroll
END
call writefile(lines, 'XTestEolLongWrapSms', 'D')
let buf = RunVimInTerminal('-S XTestEolLongWrapSms', #{rows: 8, cols: 50})
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_01', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_02', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_03', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_04', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_05', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_06', {})
call term_sendkeys(buf, 'gg$xG$')
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_07', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_08', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_09', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_10', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_11', {})
call term_sendkeys(buf, "zb:set list listchars=eol:$ | echo\<CR>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_12', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_13', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_14', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_15', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_16', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_17', {})
call term_sendkeys(buf, 'gg$xG$')
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_18', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_19', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_20', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_21', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_text_eol_long_wrap_sms_22', {})
call StopVimInTerminal(buf)
endfunc
func Test_text_below_nowrap()
CheckScreendump
CheckRunVimInTerminal

View File

@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1798,
/**/
1797,
/**/