]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-240 v7.2.240
authorBram Moolenaar <Bram@vim.org>
Wed, 29 Jul 2009 09:11:15 +0000 (09:11 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Jul 2009 09:11:15 +0000 (09:11 +0000)
src/gui.c
src/version.c

index e42cb40449a724949a32302b107db8cd1bf86d78..c25f760ea77c3d6ca4fa6ba988efe7ac2f38124c 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -5004,6 +5004,19 @@ gui_do_findrepl(flags, find_text, repl_text, down)
     char_u     *p;
     regmatch_T regmatch;
     int                save_did_emsg = did_emsg;
+    static int  busy = FALSE;
+
+    /* When the screen is being updated we should not change buffers and
+     * windows structures, it may cause freed memory to be used.  Also don't
+     * do this recursively (pressing "Find" quickly several times. */
+    if (updating_screen || busy)
+       return FALSE;
+
+    /* refuse replace when text cannot be changed */
+    if ((type == FRD_REPLACE || type == FRD_REPLACEALL) && text_locked())
+       return FALSE;
+
+    busy = TRUE;
 
     ga_init2(&ga, 1, 100);
     if (type == FRD_REPLACEALL)
@@ -5094,6 +5107,7 @@ gui_do_findrepl(flags, find_text, repl_text, down)
     }
 
     vim_free(ga.ga_data);
+    busy = FALSE;
     return (ga.ga_len > 0);
 }
 
index aafdbc62aeb12eccf52add6bbd7475877cb487a5..ffaaa30862059b0b34b28e8f59159a5f5d21af9b 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    240,
 /**/
     239,
 /**/