Mercurial > vim
comparison src/window.c @ 18886:050f5eaa9e50 v8.2.0004
patch 8.2.0004: get E685 and E931 if buffer reload is interrupted
Commit: https://github.com/vim/vim/commit/a6e8f888e7fc31b8ab7233509254fb2e2fe4089f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 14 16:18:15 2019 +0100
patch 8.2.0004: get E685 and E931 if buffer reload is interrupted
Problem: Get E685 and E931 if buffer reload is interrupted.
Solution: Do not abort deleting a dummy buffer. (closes https://github.com/vim/vim/issues/5361)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 14 Dec 2019 16:30:04 +0100 |
parents | 15539899a112 |
children | bfcafd1a3e37 |
comparison
equal
deleted
inserted
replaced
18885:f4852c310de1 | 18886:050f5eaa9e50 |
---|---|
2408 { | 2408 { |
2409 bufref_T bufref; | 2409 bufref_T bufref; |
2410 | 2410 |
2411 set_bufref(&bufref, curbuf); | 2411 set_bufref(&bufref, curbuf); |
2412 win->w_closing = TRUE; | 2412 win->w_closing = TRUE; |
2413 close_buffer(win, win->w_buffer, action, abort_if_last); | 2413 close_buffer(win, win->w_buffer, action, abort_if_last, FALSE); |
2414 if (win_valid_any_tab(win)) | 2414 if (win_valid_any_tab(win)) |
2415 win->w_closing = FALSE; | 2415 win->w_closing = FALSE; |
2416 // Make sure curbuf is valid. It can become invalid if 'bufhidden' is | 2416 // Make sure curbuf is valid. It can become invalid if 'bufhidden' is |
2417 // "wipe". | 2417 // "wipe". |
2418 if (!bufref_valid(&bufref)) | 2418 if (!bufref_valid(&bufref)) |
2675 && win->w_buffer->b_locked > 0)) | 2675 && win->w_buffer->b_locked > 0)) |
2676 return; // window is already being closed | 2676 return; // window is already being closed |
2677 | 2677 |
2678 if (win->w_buffer != NULL) | 2678 if (win->w_buffer != NULL) |
2679 // Close the link to the buffer. | 2679 // Close the link to the buffer. |
2680 close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE); | 2680 close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, |
2681 FALSE, FALSE); | |
2681 | 2682 |
2682 // Careful: Autocommands may have closed the tab page or made it the | 2683 // Careful: Autocommands may have closed the tab page or made it the |
2683 // current tab page. | 2684 // current tab page. |
2684 for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next) | 2685 for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next) |
2685 ; | 2686 ; |
4999 win_free_popup(win_T *win) | 5000 win_free_popup(win_T *win) |
5000 { | 5001 { |
5001 if (bt_popup(win->w_buffer)) | 5002 if (bt_popup(win->w_buffer)) |
5002 win_close_buffer(win, DOBUF_WIPE_REUSE, FALSE); | 5003 win_close_buffer(win, DOBUF_WIPE_REUSE, FALSE); |
5003 else | 5004 else |
5004 close_buffer(win, win->w_buffer, 0, FALSE); | 5005 close_buffer(win, win->w_buffer, 0, FALSE, FALSE); |
5005 # if defined(FEAT_TIMERS) | 5006 # if defined(FEAT_TIMERS) |
5006 if (win->w_popup_timer != NULL) | 5007 if (win->w_popup_timer != NULL) |
5007 stop_timer(win->w_popup_timer); | 5008 stop_timer(win->w_popup_timer); |
5008 # endif | 5009 # endif |
5009 vim_free(win->w_frame); | 5010 vim_free(win->w_frame); |