diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-11-24 16:32:05 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-11-24 16:32:05 +0100 |
commit | 0785ccf99523b07cf4edd34ba685310d069631f4 (patch) | |
tree | c8a7bdd7effb59afa358eefa7ca7e7c262388b71 /src/quickfix.c | |
parent | 4dbbff57baebde02a8bdb26a25947c3964ec6198 (diff) | |
download | vim-git-0785ccf99523b07cf4edd34ba685310d069631f4.tar.gz |
updated for version 7.3.066v7.3.066
Problem: Crash when changing to another window while in a :vimgrep command.
(Christian Brabandt)
Solution: When wiping out the dummy before, remove it from aucmd_win.
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 024952379..5060675fd 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -3432,6 +3432,7 @@ load_dummy_buffer(fname) char_u *fname; { buf_T *newbuf; + buf_T *newbuf_to_wipe = NULL; int failed = TRUE; aco_save_T aco; @@ -3468,15 +3469,19 @@ load_dummy_buffer(fname) failed = FALSE; if (curbuf != newbuf) { - /* Bloody autocommands changed the buffer! */ - if (buf_valid(newbuf)) - wipe_buffer(newbuf, FALSE); + /* Bloody autocommands changed the buffer! Can happen when + * using netrw and editing a remote file. Use the current + * buffer instead, delete the dummy one after restoring the + * window stuff. */ + newbuf_to_wipe = newbuf; newbuf = curbuf; } } /* restore curwin/curbuf and a few other things */ aucmd_restbuf(&aco); + if (newbuf_to_wipe != NULL && buf_valid(newbuf_to_wipe)) + wipe_buffer(newbuf_to_wipe, FALSE); } if (!buf_valid(newbuf)) |