Mercurial > vim
comparison src/quickfix.c @ 2646:ff3a304b4ac2 v7.3.066
updated for version 7.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.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 24 Nov 2010 16:32:05 +0100 |
parents | 7c2e6ba1d702 |
children | b254cfdd7405 |
comparison
equal
deleted
inserted
replaced
2645:a2271decbce5 | 2646:ff3a304b4ac2 |
---|---|
3430 static buf_T * | 3430 static buf_T * |
3431 load_dummy_buffer(fname) | 3431 load_dummy_buffer(fname) |
3432 char_u *fname; | 3432 char_u *fname; |
3433 { | 3433 { |
3434 buf_T *newbuf; | 3434 buf_T *newbuf; |
3435 buf_T *newbuf_to_wipe = NULL; | |
3435 int failed = TRUE; | 3436 int failed = TRUE; |
3436 aco_save_T aco; | 3437 aco_save_T aco; |
3437 | 3438 |
3438 /* Allocate a buffer without putting it in the buffer list. */ | 3439 /* Allocate a buffer without putting it in the buffer list. */ |
3439 newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY); | 3440 newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY); |
3466 && !(curbuf->b_flags & BF_NEW)) | 3467 && !(curbuf->b_flags & BF_NEW)) |
3467 { | 3468 { |
3468 failed = FALSE; | 3469 failed = FALSE; |
3469 if (curbuf != newbuf) | 3470 if (curbuf != newbuf) |
3470 { | 3471 { |
3471 /* Bloody autocommands changed the buffer! */ | 3472 /* Bloody autocommands changed the buffer! Can happen when |
3472 if (buf_valid(newbuf)) | 3473 * using netrw and editing a remote file. Use the current |
3473 wipe_buffer(newbuf, FALSE); | 3474 * buffer instead, delete the dummy one after restoring the |
3475 * window stuff. */ | |
3476 newbuf_to_wipe = newbuf; | |
3474 newbuf = curbuf; | 3477 newbuf = curbuf; |
3475 } | 3478 } |
3476 } | 3479 } |
3477 | 3480 |
3478 /* restore curwin/curbuf and a few other things */ | 3481 /* restore curwin/curbuf and a few other things */ |
3479 aucmd_restbuf(&aco); | 3482 aucmd_restbuf(&aco); |
3483 if (newbuf_to_wipe != NULL && buf_valid(newbuf_to_wipe)) | |
3484 wipe_buffer(newbuf_to_wipe, FALSE); | |
3480 } | 3485 } |
3481 | 3486 |
3482 if (!buf_valid(newbuf)) | 3487 if (!buf_valid(newbuf)) |
3483 return NULL; | 3488 return NULL; |
3484 if (failed) | 3489 if (failed) |