]> granicus.if.org Git - vim/commitdiff
patch 9.0.0184: virtual text prop highlight continues after truncation v9.0.0184
authorBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2022 12:39:35 +0000 (13:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2022 12:39:35 +0000 (13:39 +0100)
Problem:    Virtual text prop highlight continues after truncation.
Solution:   Recompute the length of attributes.

src/drawline.c
src/testdir/dumps/Test_prop_with_wrap_1.dump [new file with mode: 0644]
src/testdir/test_textprop.vim
src/version.c

index 0300f373a61764e8f409a04e905f257575bce2be..5d9dcc37e249540ab09457e34f93f737926851e7 100644 (file)
@@ -1793,6 +1793,7 @@ win_line(
                                        wlv.p_extra = p_extra_free2 = l;
                                        wlv.n_extra = n_used + added;
                                        n_attr_skip = added;
+                                       n_attr = mb_charlen(wlv.p_extra);
                                    }
                                }
 
diff --git a/src/testdir/dumps/Test_prop_with_wrap_1.dump b/src/testdir/dumps/Test_prop_with_wrap_1.dump
new file mode 100644 (file)
index 0000000..c4bf866
--- /dev/null
@@ -0,0 +1,6 @@
+>a+0&#ffffff0|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|s+0#e000e06&|o|m|e| |v|i|…
+|d+0#0000000&|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| @17
+|~+0#4040ff13&| @48
+|~| @48
+|~| @48
+| +0#0000000&@31|1|,|1| @10|A|l@1| 
index dd3f760aaac0662ae21c73bd56bdc2dd181c2e3a..8533af3cd25c1bafb8d1ffa76a55f62c64d8626d 100644 (file)
@@ -1898,6 +1898,24 @@ func Test_prop_with_linebreak()
   call delete('XscriptPropWithLinebreak')
 endfunc
 
+func Test_prop_with_wrap()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      vim9script
+      set linebreak
+      setline(1, 'asdf '->repeat(15))
+      prop_type_add('test', {highlight: 'Special'})
+      prop_add(1, 43, {text: 'some virtual text', type: 'test'})
+  END
+  call writefile(lines, 'XscriptPropWithWrap')
+  let buf = RunVimInTerminal('-S XscriptPropWithWrap', #{rows: 6, cols: 50})
+  call VerifyScreenDump(buf, 'Test_prop_with_wrap_1', {})
+
+  call StopVimInTerminal(buf)
+  call delete('XscriptPropWithWrap')
+endfunc
+
 func Test_prop_after_tab()
   CheckRunVimInTerminal
 
index 582cb3655abf312c82e38b3e34624f8493ec11a2..27503b5951dfeea52c51353895753dfadd5931ea 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    184,
 /**/
     183,
 /**/