To: vim_dev@googlegroups.com Subject: Patch 9.0.0186 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0186 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) Files: src/drawline.c, src/testdir/test_textprop.vim 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 *** ../vim-9.0.0185/src/drawline.c 2022-08-10 16:00:13.229597192 +0100 --- src/drawline.c 2022-08-10 16:37:35.972286915 +0100 *************** *** 1706,1712 **** proptype_T *pt = text_prop_type_by_id( wp->w_buffer, text_props[tpi].tp_type); ! if (pt != NULL && pt->pt_hl_id > 0 && text_props[tpi].tp_id != -MAXCOL) { used_attr = syn_id2attr(pt->pt_hl_id); --- 1706,1713 ---- proptype_T *pt = text_prop_type_by_id( wp->w_buffer, text_props[tpi].tp_type); ! 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); *** ../vim-9.0.0185/src/testdir/test_textprop.vim 2022-08-10 16:00:13.229597192 +0100 --- src/testdir/test_textprop.vim 2022-08-10 16:45:16.723484330 +0100 *************** *** 2469,2480 **** 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_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'}) END call writefile(lines, 'XscriptPropsWithText') let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 8, cols: 60}) --- 2469,2484 ---- 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_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}) *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_1.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_1.dump 2022-08-10 16:45:38.959448080 +0100 *************** *** 3,8 **** |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 |~+0#4040ff13&| @58 - |~| @58 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| --- 3,8 ---- |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 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_2.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_2.dump 2022-08-10 16:45:40.115446200 +0100 *************** *** 3,8 **** | +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#4040ff13&| @58 - |~| @58 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| --- 3,8 ---- | +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 | +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1| *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_3.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_3.dump 2022-08-10 16:45:41.271444320 +0100 *************** *** 3,8 **** | +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#4040ff13&| @58 - |~| @58 | +0#0000000&@41|2|,|7|-|1|9| @7|A|l@1| --- 3,8 ---- | +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 | +0#0000000&@41|2|,|7|-|1|9| @7|A|l@1| *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_4.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_4.dump 2022-08-10 16:45:42.431442431 +0100 *************** *** 3,8 **** | +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#4040ff13&| @58 - |~| @58 | +0#0000000&@41|3|,|1|3|-|1|6| @6|A|l@1| --- 3,8 ---- | +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 | +0#0000000&@41|3|,|1|3|-|1|6| @6|A|l@1| *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_5.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_5.dump 2022-08-10 16:45:43.587440554 +0100 *************** *** 3,8 **** | +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#4040ff13&| @58 - |~| @58 | +0#0000000&@41|3|,|1|6|-|2@1| @6|A|l@1| --- 3,8 ---- | +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 | +0#0000000&@41|3|,|1|6|-|2@1| @6|A|l@1| *** ../vim-9.0.0185/src/testdir/dumps/Test_prop_inserts_text_6.dump 2022-08-08 11:07:25.268222468 +0100 --- src/testdir/dumps/Test_prop_inserts_text_6.dump 2022-08-10 16:45:44.743438675 +0100 *************** *** 3,8 **** | +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#4040ff13&| @58 - |~| @58 | +0#0000000&@41|4|,|0|-|1| @8|A|l@1| --- 3,8 ---- | +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 | +0#0000000&@41|4|,|0|-|1| @8|A|l@1| *** ../vim-9.0.0185/src/version.c 2022-08-10 16:00:13.229597192 +0100 --- src/version.c 2022-08-10 16:42:59.079712796 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 186, /**/ -- Facepalm statement #4: "3000 year old graves? That's not possible, it's only 2014!" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///