]> granicus.if.org Git - vim/commitdiff
patch 8.1.2176: syntax attributes not combined with Visual highlighting v8.1.2176
authorBram Moolenaar <Bram@vim.org>
Fri, 18 Oct 2019 21:12:20 +0000 (23:12 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 18 Oct 2019 21:12:20 +0000 (23:12 +0200)
Problem:    Syntax attributes not combined with Visual highlighting. (Arseny
            Nasokin)
Solution:   Combine the attributes. (closes #5083)

src/drawline.c
src/testdir/dumps/Test_syntax_c_01.dump
src/testdir/test_syntax.vim
src/version.c

index 333eeba29739ed712f8d62dc08ce2d489cc8139b..ef3b69f8c2649c1ccde8536caec56ec02d7da9d0 100644 (file)
@@ -1470,9 +1470,21 @@ win_line(
            attr_pri = TRUE;
 #ifdef LINE_ATTR
            if (area_attr != 0)
+           {
                char_attr = hl_combine_attr(line_attr, area_attr);
+# ifdef FEAT_SYN_HL
+               if (syntax_attr != 0)
+                   char_attr = hl_combine_attr(syntax_attr, char_attr);
+# endif
+           }
            else if (search_attr != 0)
+           {
                char_attr = hl_combine_attr(line_attr, search_attr);
+# ifdef FEAT_SYN_HL
+               if (syntax_attr != 0)
+                   char_attr = hl_combine_attr(syntax_attr, char_attr);
+# endif
+           }
 # ifdef FEAT_TEXT_PROP
            else if (text_prop_type != NULL)
            {
index 54e34a60359dd8a36c94bc0dbd675689679b6c24..d70f45ac6102194de4a3b1b9dce94e8cf64904dc 100644 (file)
@@ -1,4 +1,4 @@
->/+0#0000e05#ffffff0|*| |c|o|m@1|e|n|t| |l|i|n|e| |a|t| |t|h|e| |t|o|p| |*|/| +0#0000000&@45
+|/+0#0000e05#ffffff0|*| |c|o|m@1|e|n|t| |l|i|n|e| |a|t| |t|h|e| |t|o|p| |*|/| +0#0000000&@45
 @2|i+0#00e0003&|n|t| +0#0000000&@69
 |m|a|i|n|(|i+0#00e0003&|n|t| +0#0000000&|a|r|g|c|,| |c+0#00e0003&|h|a|r| +0#0000000&|*@1|a|r|g|v|)|/+0#0000e05&@1| |a|n|o|t|h|e|r| |c|o|m@1|e|n|t| +0#0000000&@29
 |{| @73
@@ -6,15 +6,15 @@
 | +0#0000e05&@2|i|n|t| @2|n|o|t|_|u|s|e|d|;| +0#0000000&@56
 |#+0#e000e06&|e|l|s|e| +0#0000000&@69
 @3|i+0#00e0003&|n|t| +0#0000000&@2|u|s|e|d|;| @60
-|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68
-@3|p|r|i|n|t|f|(|"+0#e000002&|J|u|s|t| |a|n| |e|x|a|m|p|l|e| |p|i|e|c|e| |o|f| |C| |c|o|d|e|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @27
+|#+0#e000e06&|e+0&#e0e0e08|n|d|i|f| +0#0000000&| +0&#ffffff0@67
+| +0&#e0e0e08@2|p|r|i|n|t|f|(|"+0#e000002&|J|u|s|t| |a|n| |e|x|a|m|p|l|e| |p|i|e|c|e| |o|f| >C+0&#ffffff0| |c|o|d|e|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @27
 @3|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|0+0#e000002&|x|0|f@1|;+0#0000000&| @58
 |}| @73
 @3|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&@60
 |m|y|F|u|n|c|t|i|o|n|(|c+0#00e0003&|o|n|s|t| +0#0000000&|d+0#00e0003&|o|u|b|l|e| +0#0000000&|c|o|u|n|t|,| |s+0#00e0003&|t|r|u|c|t| +0#0000000&|n|o|t|h|i|n|g|,| |l+0#00e0003&|o|n|g| +0#0000000&|t|h|e|r|e|)| |{| @14
-@1| +0#0000e05&@6|/@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |r|e|a|d| |h|e|r|e| +0#0000000&@38
+@1| +0#0000e05&@6|/@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |e+0&#ffff4012|n|d|i|f| +0&#ffffff0|h|e|r|e| +0#0000000&@37
 @1| +0#af5f00255&@6|f|o|r| +0#0000000&|(|i+0#00e0003&|n|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |<| |c|o|u|n|t|;| |+@1|i|)| |{| @33
 @11|b+0#af5f00255&|r|e|a|k|;+0#0000000&| @57
 @8|}| @65
 |}| @73
-|"|X|t|e|s|t|.|c|"| |1|9|L|,| |3|6|1|C| @37|1|,|1| @10|A|l@1| 
+|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1| 
index c7d6f2db85f80dc5b42a381aabc3a528138b3ada..6705c57b5f43474f0ecd502108703cc3ce499440 100644 (file)
@@ -551,7 +551,7 @@ func Test_syntax_c()
        \ '}',
        \ '   static void',
        \ 'myFunction(const double count, struct nothing, long there) {',
-       \ "\t// 123: nothing to read here",
+       \ "\t// 123: nothing to endif here",
        \ "\tfor (int i = 0; i < count; ++i) {",
        \ "\t   break;",
        \ "\t}",
@@ -563,7 +563,12 @@ func Test_syntax_c()
   let $COLORFGBG = '15;0'
 
   let buf = RunVimInTerminal('Xtest.c', {})
+  call term_sendkeys(buf, ":set hlsearch\r")
+  call term_sendkeys(buf, "/endif\r")
+  call term_sendkeys(buf, "vjfC")
   call VerifyScreenDump(buf, 'Test_syntax_c_01', {})
+
+  call term_sendkeys(buf, "\<Esc>")
   call StopVimInTerminal(buf)
 
   let $COLORFGBG = ''
index e371d68dbf8e458eba1ca7d14c7e3b49ef36c019..3a7347c879f9ec505150c353125fd9dc20ad6879 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2176,
 /**/
     2175,
 /**/