diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-13 14:21:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-13 14:21:37 +0800 |
commit | c9b94188d5f96349566372e8a0ce94e14fd6b549 (patch) | |
tree | 8a3581dede8900e36a009bc086a503fb1e87fbe8 /src/nvim/window.c | |
parent | d33aebb821b7e7c9197b035c9152859e0b6ed712 (diff) | |
parent | ff48e61ec9ce0fed62b31609c2a83caaa862ccba (diff) | |
download | rneovim-c9b94188d5f96349566372e8a0ce94e14fd6b549.tar.gz rneovim-c9b94188d5f96349566372e8a0ce94e14fd6b549.tar.bz2 rneovim-c9b94188d5f96349566372e8a0ce94e14fd6b549.zip |
Merge pull request #17702 from zeertzjq/vim-8.1.0877
vim-patch:8.1.{0877,0892,1015},8.2.{3759,3762}: quickfix patches
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index d5299202b0..d659f60e66 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1420,13 +1420,11 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) p_wh = i; } - if (!win_valid(oldwin)) { - return FAIL; + if (win_valid(oldwin)) { + // Send the window positions to the UI + oldwin->w_pos_changed = true; } - // Send the window positions to the UI - oldwin->w_pos_changed = true; - return OK; } @@ -2598,6 +2596,13 @@ int win_close(win_T *win, bool free_buf, bool force) reset_synblock(win); } + // When a quickfix/location list window is closed and the buffer is + // displayed in only one window, then unlist the buffer. + if (win->w_buffer != NULL && bt_quickfix(win->w_buffer) + && win->w_buffer->b_nwindows == 1) { + win->w_buffer->b_p_bl = false; + } + /* * Close the link to the buffer. */ @@ -7197,16 +7202,14 @@ void win_id2tabwin(typval_T *const argvars, typval_T *const rettv) tv_list_append_number(list, winnr); } -win_T *win_id2wp(typval_T *argvars) +win_T *win_id2wp(int id) { - return win_id2wp_tp(argvars, NULL); + return win_id2wp_tp(id, NULL); } // Return the window and tab pointer of window "id". -win_T *win_id2wp_tp(typval_T *argvars, tabpage_T **tpp) +win_T *win_id2wp_tp(int id, tabpage_T **tpp) { - int id = tv_get_number(&argvars[0]); - FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->handle == id) { if (tpp != NULL) { |