Skip to content

Commit

Permalink
patch 9.0.0147: cursor positioned wrong after two "below" text proper…
Browse files Browse the repository at this point in the history
…ties

Problem:    Cursor positioned wrong after two text properties with virtual
            text and "below" alignment. (Tim Pope)
Solution:   Do not stop after a text property using MAXCOL. (closes #10849)
  • Loading branch information
brammool committed Aug 5, 2022
1 parent 4d2031f commit 50e75fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charset.c
Expand Up @@ -1173,7 +1173,7 @@ win_lbr_chartabsize(
size += cells;
}
}
if (tp->tp_col - 1 > col)
if (tp->tp_col != MAXCOL && tp->tp_col - 1 > col)
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/testdir/dumps/Test_prop_with_text_after_1.dump
@@ -1,6 +1,8 @@
|s+0&#ffffff0|o|m|e| |t|e|x|t| |h|e|r|e| |a|n|d| |o|t|h|e|r| |t|e|x|t| |t|h|e|r|e| +0&#ffff4012|A|F|T|E|R| | +0&#ffffff0@10| +0#ffffff16#e000002|R|I|G|H|T|
| +0#0000000#5fd7ff255|B|E|L|O|W| | +0&#ffffff0@52
| +0&#5fd7ff255|A|L|S|O| |B|E|L|O|W| | +0&#ffffff0@47
|L|a|s|t| |l|i|n|e>.| +0&#ffff4012|A|f|t|e|r| |L|a|s|t| | +0&#ffffff0@37
|r|i|g|h|t| |h|e|r|e| @37|s+0#ffffff16#e000002|ö|m|e|和*&|平|t+&|é|x|t
|~+0#4040ff13#ffffff0| @58
|~| @58
| +0#0000000&@41|2|,|1|0| @9|A|l@1|
3 changes: 2 additions & 1 deletion src/testdir/test_textprop.vim
Expand Up @@ -2318,6 +2318,7 @@ func Test_props_with_text_after()
call prop_add(1, 0, #{type: 'rightprop', text: ' RIGHT ', text_align: 'right'})
call prop_add(1, 0, #{type: 'afterprop', text: "\tAFTER\t", text_align: 'after'})
call prop_add(1, 0, #{type: 'belowprop', text: ' BELOW ', text_align: 'below'})
call prop_add(1, 0, #{type: 'belowprop', text: ' ALSO BELOW ', text_align: 'below'})

call setline(2, 'Last line.')
call prop_add(2, 0, #{type: 'afterprop', text: ' After Last ', text_align: 'after'})
Expand All @@ -2327,7 +2328,7 @@ func Test_props_with_text_after()
call prop_add(3, 0, #{type: 'rightprop', text: 'söme和平téxt', text_align: 'right'})
END
call writefile(lines, 'XscriptPropsWithTextAfter')
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 6, cols: 60})
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 8, cols: 60})
call VerifyScreenDump(buf, 'Test_prop_with_text_after_1', {})

call StopVimInTerminal(buf)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
147,
/**/
146,
/**/
Expand Down

0 comments on commit 50e75fe

Please sign in to comment.