diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-19 17:38:03 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-19 17:38:03 +0200 |
commit | a74fda6f4d21d8e0652e9cfa04dd3e041f779f62 (patch) | |
tree | 1220a8808f31a0d960ed39fe07e9f67d46849aae /src/drawline.c | |
parent | 00e192becd50a38cb21a1bc3f86fcc7a21f8ee88 (diff) | |
download | vim-git-a74fda6f4d21d8e0652e9cfa04dd3e041f779f62.tar.gz |
patch 8.1.2181: highlighting wrong when item follows tabv8.1.2181
Problem: Highlighting wrong when item follows tab.
Solution: Don't use syntax attribute when n_extra is non-zero.
(Christian Brabandt, closes #5076)
Diffstat (limited to 'src/drawline.c')
-rw-r--r-- | src/drawline.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/drawline.c b/src/drawline.c index ef3b69f8c..a13c330c5 100644 --- 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 } +#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) |