Skip to content

Commit 02edfaa

Browse files
committed
patch 9.0.0905: virtual text after the line wraps when 'wrap' is off
Problem: Virtual text after the line wraps when 'wrap' is off. Solution: Only set text_prop_follows when wrapping. (closes #11463)
1 parent 88456cd commit 02edfaa

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

src/drawline.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,9 @@ win_line(
20432043
p_extra_free2 = wlv.p_extra;
20442044
}
20452045

2046-
if (lcs_eol_one < 0 && wlv.col
2046+
if (lcs_eol_one < 0
2047+
&& wp->w_p_wrap
2048+
&& wlv.col
20472049
+ wlv.n_extra - 2 > wp->w_width)
20482050
// don't bail out at end of line
20492051
text_prop_follows = TRUE;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
|s+0&#ffffff0|o|m|e| |t|e|x|t| |h|e|r|e|$+0#4040ff13&| +0#0000000&@1|T+0&#ffd7ff255|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s|.| +0&#ffffff0@1|■+0&#ffd7ff255| |T|h|e| |f|o|x| |j|u|m|p|>+0#4040ff13#ffffff0
2+
|$| +0#0000000&@58
3+
|l|a|s|t| |l|i|n>e|$+0#4040ff13&| +0#0000000&@49
4+
|~+0#4040ff13&| @58
5+
|~| @58
6+
| +0#0000000&@41|3|,|9| @10|A|l@1|

src/testdir/test_textprop.vim

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3393,6 +3393,42 @@ func Test_text_after_nowrap()
33933393
call StopVimInTerminal(buf)
33943394
endfunc
33953395

3396+
func Test_text_after_nowrap_list()
3397+
CheckRunVimInTerminal
3398+
3399+
let lines =<< trim END
3400+
vim9script
3401+
3402+
set nowrap
3403+
set listchars+=extends:>
3404+
set list
3405+
setline(1, ['some text here', '', 'last line'])
3406+
3407+
prop_type_add('test', {highlight: 'DiffChange'})
3408+
prop_add(1, 0, {
3409+
type: 'test',
3410+
text: 'The quick brown fox jumps.',
3411+
text_padding_left: 2,
3412+
})
3413+
prop_add(1, 0, {
3414+
type: 'test',
3415+
text: '■ The fox jumps over the lazy dog.',
3416+
text_padding_left: 2,
3417+
})
3418+
prop_add(1, 0, {
3419+
type: 'test',
3420+
text: '■ The lazy dog.',
3421+
text_padding_left: 2,
3422+
})
3423+
normal 3G$
3424+
END
3425+
call writefile(lines, 'XTextAfterNowrapList', 'D')
3426+
let buf = RunVimInTerminal('-S XTextAfterNowrapList', #{rows: 6, cols: 60})
3427+
call VerifyScreenDump(buf, 'Test_text_after_nowrap_list_1', {})
3428+
3429+
call StopVimInTerminal(buf)
3430+
endfunc
3431+
33963432
func Test_text_below_nowrap()
33973433
CheckRunVimInTerminal
33983434

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
905,
698700
/**/
699701
904,
700702
/**/

0 commit comments

Comments
 (0)