]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0186: virtual text without highlighting does not show v9.0.0186
authorBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2022 15:49:02 +0000 (16:49 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 10 Aug 2022 15:49:02 +0000 (16:49 +0100)
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)

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

index 2b47648308ed1df27eeade3f30af8fa355a69e89..d38cf7347ba959cc885357403b9d48aa25cfc9a7 100644 (file)
@@ -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);
index 2cd71f6fe15a291b90a9975a5ad95df04706762c..7d1b1027add1aba73b6ada6bdba4a4247dbc864f 100644 (file)
@@ -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| 
index 095e232d64fbeb4888ea2637a0a9e22a16798846..2a5b2f3a75ed2fae8daa62b5e3715b08c92afac8 100644 (file)
@@ -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| 
index b438142cfecb2ca8a96d0c5df4458387faadb192..36a4b8ce1e0a40085b83392f8b77b7b845f5fd77 100644 (file)
@@ -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| 
index 8c3a022a082f9fab98633aed5500e20f33ca4024..8bb637af11a956f3beb3fc99e896910d19d93b37 100644 (file)
@@ -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| 
index c7e1c57d7eb8543f1e7eaa1b935e5ae090de1b72..75194f6158de4e5b646b41b3223bac931739c1fc 100644 (file)
@@ -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| 
index acef485b00396f37eec1aa209a08bf7c598f3de5..fb25ddf30928a38ec17d6e618acbc903e6578b01 100644 (file)
@@ -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| 
index 29cd59968270c96159d054c02d949f72a6c4db1b..c6d15b5bd765dc7d47a615ea8e9dac8704aaa7e7 100644 (file)
@@ -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})
index eb9566cc23f8bce0293e960e92a71e59233051ef..6e278e5fac357c524b63ba82dca7c77cbfb8444b 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    186,
 /**/
     185,
 /**/