aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index ce322e1185..82e97ea00d 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2018,10 +2018,12 @@ int win_close(win_T *win, int free_buf)
}
curbuf = curwin->w_buffer;
close_curwin = TRUE;
+
+ // The cursor position may be invalid if the buffer changed after last
+ // using the window.
+ check_cursor();
}
- if (p_ea
- && (*p_ead == 'b' || *p_ead == dir)
- ) {
+ if (p_ea && (*p_ead == 'b' || *p_ead == dir)) {
win_equal(curwin, true, dir);
} else {
win_comp_pos();