diff options
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index cdccb57eee..4e4ca1f8f3 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -7884,7 +7884,11 @@ static void ins_mousescroll(int dir) col = mouse_col; /* find the window at the pointer coordinates */ - curwin = mouse_find_win(&row, &col); + win_T *const wp = mouse_find_win(&row, &col); + if (wp == NULL) { + return; + } + curwin = wp; curbuf = curwin->w_buffer; } if (curwin == old_curwin) |