summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-05 20:25:50 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-05 20:25:50 +0100
commit50e75fe8d8c8ab262ab5b11d1498e5628044e07c (patch)
tree1aa13fb898b0788ff697cde4b9d3885c796c35c1
parent4d2031fdbe833431269a960dd2f0287dbcaa92f9 (diff)
patch 9.0.0147: cursor positioned wrong after two "below" text propertiesv9.0.0147
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)
-rw-r--r--src/charset.c2
-rw-r--r--src/testdir/dumps/Test_prop_with_text_after_1.dump2
-rw-r--r--src/testdir/test_textprop.vim3
-rw-r--r--src/version.c2
4 files changed, 7 insertions, 2 deletions
diff --git a/src/charset.c b/src/charset.c
index f7ce33505d..b245bd763e 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -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;
}
}
diff --git a/src/testdir/dumps/Test_prop_with_text_after_1.dump b/src/testdir/dumps/Test_prop_with_text_after_1.dump
index 0467e9c5f9..c64d1698d5 100644
--- a/src/testdir/dumps/Test_prop_with_text_after_1.dump
+++ b/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|
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index df06f38fe5..311de947fb 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -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'})
@@ -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)
diff --git a/src/version.c b/src/version.c
index 80b6cd677c..fcee2220c4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 147,
+/**/
146,
/**/
145,