diff options
author | Bram Moolenaar <Bram@vim.org> | 2009-07-29 09:11:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2009-07-29 09:11:15 +0000 |
commit | 9f8650c969f78833f2f053d037fc495ffb2c6888 (patch) | |
tree | d2630835b554b9f66cd5eb14b5e1905d4d869a1a /src/gui.c | |
parent | 6ec0a6c43da9b5241baa852968e8d76a9366905e (diff) | |
download | vim-9f8650c969f78833f2f053d037fc495ffb2c6888.zip |
updated for version 7.2-240
Diffstat (limited to 'src/gui.c')
-rw-r--r-- | src/gui.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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); } |