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 | ed9f926127660a3ab6bdfffdfca3a52e81e3e604 (patch) | |
tree | ff9511b1159b45c330e36ecca61eaf427721e29d | |
parent | 4df5286a86d7044630aff7bc16a98573129e6c41 (diff) | |
download | vim-ed9f926127660a3ab6bdfffdfca3a52e81e3e604.tar.gz |
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.
-rw-r--r-- | src/quickfix.c | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 02495237..5060675f 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)) diff --git a/src/version.c b/src/version.c index e334d0a3..95c02628 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 66, +/**/ 65, /**/ 64, |