summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-16 22:46:01 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-16 22:46:01 +0200
commit989a70c590c2bd109eb362d3a0e48cb1427ae13d (patch)
treee35f05c19c3589b00450a54c40d3d928b32b0500 /src/edit.c
parent6fe15bbc87cb996912fe3c2c4068e356071ac516 (diff)
downloadvim-git-989a70c590c2bd109eb362d3a0e48cb1427ae13d.tar.gz
patch 8.0.0948: crash if timer closes window while dragging status linev8.0.0948
Problem: Crash if timer closes window while dragging status line. Solution: Check if the window still exists. (Yasuhiro Matsumoto, closes #1979)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c
index e08370863..3a9b3aaf9 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -9418,7 +9418,7 @@ ins_mousescroll(int dir)
{
pos_T tpos;
# if defined(FEAT_WINDOWS)
- win_T *old_curwin = curwin;
+ win_T *old_curwin = curwin, *wp;
# endif
# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
@@ -9435,7 +9435,10 @@ ins_mousescroll(int dir)
col = mouse_col;
/* find the window at the pointer coordinates */
- curwin = mouse_find_win(&row, &col);
+ wp = mouse_find_win(&row, &col);
+ if (wp == NULL)
+ return;
+ curwin = wp;
curbuf = curwin->w_buffer;
}
if (curwin == old_curwin)