aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-14 18:50:44 -0400
committerGitHub <noreply@github.com>2021-05-14 18:50:44 -0400
commitc57a85d53490fe53158a0cbd768941b732926d83 (patch)
treeeea995585edb66a7522f20faaab27144ce30c271 /src/nvim/ex_getln.c
parentba04b3d8381c1573fabbe2c78abe87b2b0dd0026 (diff)
parent520b925627604a5c3030d4e59dc2caa2f6501736 (diff)
downloadrneovim-c57a85d53490fe53158a0cbd768941b732926d83.tar.gz
rneovim-c57a85d53490fe53158a0cbd768941b732926d83.tar.bz2
rneovim-c57a85d53490fe53158a0cbd768941b732926d83.zip
Merge pull request #14532 from janlazo/vim-8.1.1433
vim-patch:8.0.1394,8.1.1967,8.2.{23,1000,1059,2354,2419,2433,2473,2850}
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 53571ec8da..43762e8d6b 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -6635,11 +6635,13 @@ static int open_cmdwin(void)
wp = curwin;
set_bufref(&bufref, curbuf);
win_goto(old_curwin);
- win_close(wp, true);
+ if (win_valid(wp) && wp != curwin) {
+ win_close(wp, true);
+ }
// win_close() may have already wiped the buffer when 'bh' is
- // set to 'wipe'.
- if (bufref_valid(&bufref)) {
+ // set to 'wipe', autocommands may have closed other windows
+ if (bufref_valid(&bufref) && bufref.br_buf != curbuf) {
close_buffer(NULL, bufref.br_buf, DOBUF_WIPE, false);
}