]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.349 v7.4.349
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Jul 2014 15:16:58 +0000 (17:16 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Jul 2014 15:16:58 +0000 (17:16 +0200)
Problem:    When there are matches to highlight the whole window is redrawn,
            which is slow.
Solution:   Only redraw everything when lines were inserted or deleted.
            Reset b_mod_xlines when needed.  (Alexey Radkov)

src/screen.c
src/version.c
src/window.c

index 8e616915bf91cc65aad22f8168e40d93be09c160..65aadc4235205f66f9743837e11f452d4fd8f86e 100644 (file)
@@ -1769,8 +1769,10 @@ win_update(wp)
                                        syntax_check_changed(lnum)))
 #endif
 #ifdef FEAT_SEARCH_EXTRA
-                               /* match in fixed position might need redraw */
-                               ||  wp->w_match_head != NULL
+                               /* match in fixed position might need redraw
+                                * if lines were inserted or deleted */
+                               || (wp->w_match_head != NULL
+                                                   && buf->b_mod_xlines != 0)
 #endif
                                )))))
        {
index 214f24a8b3eaf18747e0ddbbb897b735ccaf3bb6..e86b43ddf3c1c9225b16cc8f856e89df482f74f4 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    349,
 /**/
     348,
 /**/
index 96d4771fb44b01304ecd2acbbc9a7250c621cc95..81064518c1051fa302ef1c4c317955d9e416af27 100644 (file)
@@ -6904,12 +6904,13 @@ match_add(wp, grp, pat, prio, id, pos_list)
            }
            else
            {
+               wp->w_buffer->b_mod_set = TRUE;
                wp->w_buffer->b_mod_top = toplnum;
                wp->w_buffer->b_mod_bot = botlnum;
+               wp->w_buffer->b_mod_xlines = 0;
            }
            m->pos.toplnum = toplnum;
            m->pos.botlnum = botlnum;
-           wp->w_buffer->b_mod_set = TRUE;
            rtype = VALID;
        }
     }
@@ -6986,10 +6987,11 @@ match_delete(wp, id, perr)
        }
        else
        {
+           wp->w_buffer->b_mod_set = TRUE;
            wp->w_buffer->b_mod_top = cur->pos.toplnum;
            wp->w_buffer->b_mod_bot = cur->pos.botlnum;
+           wp->w_buffer->b_mod_xlines = 0;
        }
-       wp->w_buffer->b_mod_set = TRUE;
        rtype = VALID;
     }
     vim_free(cur);