# HG changeset patch # User Bram Moolenaar # Date 1571499903 -7200 # Node ID 86c00b8fefea5ce0745524076750fa7aed2c7094 # Parent 76e7c6c09dcf34e2aeb6dbde4a1a0a3d055267e0 patch 8.1.2181: highlighting wrong when item follows tab Commit: https://github.com/vim/vim/commit/a74fda6f4d21d8e0652e9cfa04dd3e041f779f62 Author: Bram Moolenaar Date: Sat Oct 19 17:38:03 2019 +0200 patch 8.1.2181: highlighting wrong when item follows tab Problem: Highlighting wrong when item follows tab. Solution: Don't use syntax attribute when n_extra is non-zero. (Christian Brabandt, closes #5076) diff --git a/src/drawline.c b/src/drawline.c --- a/src/drawline.c +++ b/src/drawline.c @@ -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 - } // 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 + char_attr = syntax_attr; +#else + char_attr = 0; #endif - char_attr = 0; } } if (char_attr == 0) diff --git a/src/feature.h b/src/feature.h --- a/src/feature.h +++ b/src/feature.h @@ -430,18 +430,6 @@ #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 * * Disabled for EBCDIC: * Doesn't work (SIGSEGV). @@ -1119,10 +1107,6 @@ # 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. @@ -1138,6 +1122,8 @@ * +tcl TCL interface: "--enable-tclinterp" * +netbeans_intg Netbeans integration * +channel Inter process communication + * +GUI_Athena Athena GUI + * +GUI_Motif Motif GUI */ /* @@ -1170,6 +1156,23 @@ #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. diff --git a/src/testdir/dumps/Test_syntax_c_01.dump b/src/testdir/dumps/Test_syntax_c_01.dump --- a/src/testdir/dumps/Test_syntax_c_01.dump +++ b/src/testdir/dumps/Test_syntax_c_01.dump @@ -12,9 +12,11 @@ |}| @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| diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2181, +/**/ 2180, /**/ 2179,