aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index a695620801..225fe4aa9a 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3994,8 +3994,12 @@ static void nv_mousescroll(cmdarg_T *cap)
row = mouse_row;
col = mouse_col;
- /* find the window at the pointer coordinates */
- curwin = mouse_find_win(&row, &col);
+ // find the window at the pointer coordinates
+ win_T *const wp = mouse_find_win(&row, &col);
+ if (wp == NULL) {
+ return;
+ }
+ curwin = wp;
curbuf = curwin->w_buffer;
}