changeset 29692:042f357b455d v9.0.0186

patch 9.0.0186: virtual text without highlighting does not show Commit: https://github.com/vim/vim/commit/3331dd03515655ec6b9c1bd374db6e8c27acb27a Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 10 16:49:02 2022 +0100 patch 9.0.0186: virtual text without highlighting does not show Problem: Virtual text without highlighting does not show. (Ben Jackson) Solution: Use a text property when it has highlighting or when it has text. (closes #10878)
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Aug 2022 18:00:04 +0200
parents fc29950c2a44
children 9676dc9e6829
files src/drawline.c src/testdir/dumps/Test_prop_inserts_text_1.dump src/testdir/dumps/Test_prop_inserts_text_2.dump src/testdir/dumps/Test_prop_inserts_text_3.dump src/testdir/dumps/Test_prop_inserts_text_4.dump src/testdir/dumps/Test_prop_inserts_text_5.dump src/testdir/dumps/Test_prop_inserts_text_6.dump src/testdir/test_textprop.vim src/version.c
diffstat 9 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1706,7 +1706,8 @@ win_line(
 			proptype_T  *pt = text_prop_type_by_id(
 					wp->w_buffer, text_props[tpi].tp_type);
 
-			if (pt != NULL && pt->pt_hl_id > 0
+			if (pt != NULL && (pt->pt_hl_id > 0
+						  || text_props[tpi].tp_id < 0)
 					  && text_props[tpi].tp_id != -MAXCOL)
 			{
 			    used_attr = syn_id2attr(pt->pt_hl_id);
--- a/src/testdir/dumps/Test_prop_inserts_text_1.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_1.dump
@@ -3,6 +3,6 @@
 |p|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s|t| @40
 |F|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=|1+0#0000000&|,| |.+0#0000e05&|y|=|2+0#0000000&| |}|;| @34
 |e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@49
+|l|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @42
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| 
--- a/src/testdir/dumps/Test_prop_inserts_text_2.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_2.dump
@@ -3,6 +3,6 @@
 | +0#0000e05#a8a8a8255@1|p+0#0000000#ffffff0|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s|t| @38
 | +0#0000e05#a8a8a8255@1|F+0#0000000#ffffff0|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=|1+0#0000000&|,| |.+0#0000e05&|y|=|2+0#0000000&| |}|;| @32
 | +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
+| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| 
--- a/src/testdir/dumps/Test_prop_inserts_text_3.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_3.dump
@@ -3,6 +3,6 @@
 | +0#0000e05#a8a8a8255@1|p+0#0000000#ffffff0|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s>t| @38
 | +0#0000e05#a8a8a8255@1|F+0#0000000#ffffff0|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=|1+0#0000000&|,| |.+0#0000e05&|y|=|2+0#0000000&| |}|;| @32
 | +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
+| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|2|,|7|-|1|9| @7|A|l@1| 
--- a/src/testdir/dumps/Test_prop_inserts_text_4.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_4.dump
@@ -3,6 +3,6 @@
 | +0#0000e05#a8a8a8255@1|p+0#0000000#ffffff0|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s|t| @38
 | +0#0000e05#a8a8a8255@1|F+0#0000000#ffffff0|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=>1+0#0000000&|,| |.+0#0000e05&|y|=|2+0#0000000&| |}|;| @32
 | +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
+| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|3|,|1|3|-|1|6| @6|A|l@1| 
--- a/src/testdir/dumps/Test_prop_inserts_text_5.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_5.dump
@@ -3,6 +3,6 @@
 | +0#0000e05#a8a8a8255@1|p+0#0000000#ffffff0|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s|t| @38
 | +0#0000e05#a8a8a8255@1|F+0#0000000#ffffff0|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=|1+0#0000000&|,| |.+0#0000e05&|y|=>2+0#0000000&| |}|;| @32
 | +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
+| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|3|,|1|6|-|2@1| @6|A|l@1| 
--- a/src/testdir/dumps/Test_prop_inserts_text_6.dump
+++ b/src/testdir/dumps/Test_prop_inserts_text_6.dump
@@ -3,6 +3,6 @@
 | +0#0000e05#a8a8a8255@1|p+0#0000000#ffffff0|r|e|s+0&#e0e0e08|ö|m|e|和*&|平|t+&|é|x|t|p+0&#ffffff0|o|s|t| @38
 | +0#0000e05#a8a8a8255@1|F+0#0000000#ffffff0|o@1| |f|o@1| |=| |{| |.+0#0000e05&|x|=|1+0#0000000&|,| |.+0#0000e05&|y|=|2+0#0000000&| |}|;| @32
 | +0#0000e05#a8a8a8255@1>e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
+| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
 |~+0#4040ff13&| @58
-|~| @58
 | +0#0000000&@41|4|,|0|-|1| @8|A|l@1| 
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2469,12 +2469,16 @@ func Test_prop_inserts_text()
       call prop_add(2, 4, #{type: 'multibyte', text: 'söme和平téxt'})
 
       call setline(3, 'Foo foo = { 1, 2 };')
-      call prop_type_add( 'testprop', #{highlight: 'Comment'})
+      call prop_type_add('testprop', #{highlight: 'Comment'})
       call prop_add(3, 13, #{type: 'testprop', text: '.x='})
       call prop_add(3, 16, #{type: 'testprop', text: '.y='})
 
       call setline(4, '')
       call prop_add(4, 1, #{type: 'someprop', text: 'empty line'})
+
+      call setline(5, 'look highlight')
+      call prop_type_add('nohi', #{})
+      call prop_add(5, 6, #{type: 'nohi', text: 'no '})
   END
   call writefile(lines, 'XscriptPropsWithText')
   let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 8, cols: 60})
--- 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 */
 /**/
+    186,
+/**/
     185,
 /**/
     184,