]> granicus.if.org Git - vim/commitdiff
patch 9.0.0147: cursor positioned wrong after two "below" text properties v9.0.0147
authorBram Moolenaar <Bram@vim.org>
Fri, 5 Aug 2022 19:25:50 +0000 (20:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 5 Aug 2022 19:25:50 +0000 (20:25 +0100)
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)

src/charset.c
src/testdir/dumps/Test_prop_with_text_after_1.dump
src/testdir/test_textprop.vim
src/version.c

index f7ce33505d9e17af44cc7d639665693be3040868..b245bd763edb5a0ededacbf3a5d280c5c9748192 100644 (file)
@@ -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;
        }
     }
index 0467e9c5f9922f934413ef09a6f278b2aacd4672..c64d1698d5a67ac00bbfd5a0a077ce9f2ee731e7 100644 (file)
@@ -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| 
index df06f38fe523d95d41d0e44371e0c6ff7cfef256..311de947fbbc9a51a2deb5bc3041c16a5c110f3a 100644 (file)
@@ -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)
index 80b6cd677cd1e4e0ef89a00882c0431419c40a29..fcee2220c44e294e28a0acd4cba4a799f3ae6855 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    147,
 /**/
     146,
 /**/