]> granicus.if.org Git - vim/commitdiff
patch 8.1.2181: highlighting wrong when item follows tab v8.1.2181
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Oct 2019 15:38:03 +0000 (17:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Oct 2019 15:38:03 +0000 (17:38 +0200)
Problem:    Highlighting wrong when item follows tab.
Solution:   Don't use syntax attribute when n_extra is non-zero.
            (Christian Brabandt, closes #5076)

src/drawline.c
src/feature.h
src/testdir/dumps/Test_syntax_c_01.dump
src/version.c

index ef3b69f8c2649c1ccde8536caec56ec02d7da9d0..a13c330c51e7941015afbee99b130d344f854bda 100644 (file)
@@ -1399,14 +1399,14 @@ win_line(
            }
 #endif
 
-           if (extra_check)
+#ifdef FEAT_SYN_HL
+           syntax_attr = 0;
+           if (extra_check && n_extra == 0)
            {
-#ifdef FEAT_TERMINAL
+# ifdef FEAT_TERMINAL
                if (get_term_attr)
                    syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol);
-#endif
-
-#ifdef FEAT_SYN_HL
+# endif
                // Get syntax attribute.
                if (has_syntax)
                {
@@ -1463,8 +1463,8 @@ win_line(
                        syntax_flags = get_syntax_info(&syntax_seqnr);
 # endif
                }
-#endif
            }
+#endif
 
            // Decide which of the highlight attributes to use.
            attr_pri = TRUE;
@@ -1502,7 +1502,7 @@ win_line(
                // Use line_attr when not in the Visual or 'incsearch' area
                // (area_attr may be 0 when "noinvcur" is set).
 # ifdef FEAT_SYN_HL
-               if (has_syntax)
+               if (syntax_attr != 0)
                    char_attr = hl_combine_attr(syntax_attr, line_attr);
                else
 # endif
@@ -1531,15 +1531,10 @@ win_line(
                else
 #endif
 #ifdef FEAT_SYN_HL
-                   if (has_syntax
-# ifdef FEAT_TERMINAL
-                           || get_term_attr
-# endif
-                      )
-                       char_attr = syntax_attr;
-               else
-#endif
+                   char_attr = syntax_attr;
+#else
                    char_attr = 0;
+#endif
            }
        }
        if (char_attr == 0)
index 04bb30cc63f9f54a8e5650eba52c1fca058df593..4c0758d5234b7b20c98057fcdcd08e4bef1874ce 100644 (file)
 # define FEAT_CONCEAL
 #endif
 
-/*
- * +textprop           Text properties and popup windows
- */
-#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
-# define FEAT_TEXT_PROP
-#endif
-
-#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
-// Can limit syntax highlight time to 'redrawtime'.
-# define SYN_TIME_LIMIT 1
-#endif
-
 /*
  * +spell              spell checking
  *
 # define FEAT_ARP
 #endif
 
-/*
- * +GUI_Athena         To compile Vim with or without the GUI (gvim) you have
- * +GUI_Motif          to edit the Makefile.
- */
 
 /*
  * +ole                        Win32 OLE automation: Use Makefile.ovc.
  * +tcl                        TCL interface: "--enable-tclinterp"
  * +netbeans_intg      Netbeans integration
  * +channel            Inter process communication
+ * +GUI_Athena         Athena GUI
+ * +GUI_Motif          Motif GUI
  */
 
 /*
 #if defined(FEAT_TERMINAL) && !defined(CURSOR_SHAPE)
 # define CURSOR_SHAPE
 #endif
+#if defined(FEAT_TERMINAL) && !defined(FEAT_SYN_HL)
+// simplify the code a bit by enabling +syntax when +terminal is enabled
+# define FEAT_SYN_HL
+#endif
+
+/*
+ * +textprop           Text properties and popup windows
+ */
+#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
+# define FEAT_TEXT_PROP
+#endif
+
+#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
+// Can limit syntax highlight time to 'redrawtime'.
+# define SYN_TIME_LIMIT 1
+#endif
+
 
 /*
  * +signs              Allow signs to be displayed to the left of text lines.
index d70f45ac6102194de4a3b1b9dce94e8cf64904dc..bb1c3c231e5b4b9ba169712b8925e2f2ab440dab 100644 (file)
 |}| @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| |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
+@8|/+0#0000e05&@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
+@8|f+0#af5f00255&|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
+@8|N+0&#ffff4012|o|t|e|:+0&#ffffff0| |a|s|d|f| @56
 |}| @73
-|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1| 
+|~+0#4040ff13&| @73
+|-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1| 
index aebadab03d144f651022bd05ca7b0a1e09eeab9e..0fff97d466b348de63cf30406219231ef685a207 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2181,
 /**/
     2180,
 /**/