]> granicus.if.org Git - vim/commitdiff
patch 8.1.1082: "Conceal" match is mixed up with 'hlsearch' match. v8.1.1082
authorBram Moolenaar <Bram@vim.org>
Sat, 30 Mar 2019 15:39:05 +0000 (16:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 30 Mar 2019 15:39:05 +0000 (16:39 +0100)
Problem:    "Conceal" match is mixed up with 'hlsearch' match.
Solution:   Check that a match is found, not a 'hlsearch' item. (Andy
            Massimino, closes #4073)

src/screen.c
src/version.c

index c3cc8cdfa2c309b950e3ddfbac9cd7a65d154519..455c335aae1e6e6b6bb82f735ef786d65e8a22e6 100644 (file)
@@ -4133,8 +4133,12 @@ win_line(
                                shl->endcol = tmp_col;
                            shl->attr_cur = shl->attr;
 #ifdef FEAT_CONCEAL
-                           if (cur != NULL && syn_name2id((char_u *)"Conceal")
-                                                              == cur->hlg_id)
+                           // Match with the "Conceal" group results in hiding
+                           // the match.
+                           if (cur != NULL
+                                   && shl != &search_hl
+                                   && syn_name2id((char_u *)"Conceal")
+                                                               == cur->hlg_id)
                            {
                                has_match_conc =
                                             v == (long)shl->startcol ? 2 : 1;
@@ -5175,8 +5179,8 @@ win_line(
 #ifdef FEAT_CONCEAL
            if (   wp->w_p_cole > 0
                && (wp != curwin || lnum != wp->w_cursor.lnum ||
-                                                       conceal_cursor_line(wp) )
-               && ( (syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0)
+                                                      conceal_cursor_line(wp))
+               && ((syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0)
                && !(lnum_in_visual_area
                                    && vim_strchr(wp->w_p_cocu, 'v') == NULL))
            {
index fad51e22b7b4acaf97d5100ce26f2557dc5a7160..98f09b3fb4b2756d5324d36ed5b0f37a7247aa1d 100644 (file)
@@ -775,6 +775,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1082,
 /**/
     1081,
 /**/