changeset 29613:1a0aea1e23f4 v9.0.0147

patch 9.0.0147: cursor positioned wrong after two "below" text properties Commit: https://github.com/vim/vim/commit/50e75fe8d8c8ab262ab5b11d1498e5628044e07c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 5 20:25:50 2022 +0100 patch 9.0.0147: cursor positioned wrong after two "below" text properties 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 05 Aug 2022 21:30:03 +0200
parents 15c1eb8bc7fb
children 08ce158c6238
files src/charset.c src/testdir/dumps/Test_prop_with_text_after_1.dump src/testdir/test_textprop.vim src/version.c
diffstat 4 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
 	}
     }
--- 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| 
--- 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)
--- 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,