diff options
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 6b5a824bd..0f0f17075 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -6252,7 +6252,11 @@ ex_window() bp = curbuf; win_goto(old_curwin); win_close(wp, TRUE); - close_buffer(NULL, bp, DOBUF_WIPE); + + /* win_close() may have already wiped the buffer when 'bh' is + * set to 'wipe' */ + if (buf_valid(bp)) + close_buffer(NULL, bp, DOBUF_WIPE); /* Restore window sizes. */ win_size_restore(&winsizes); |