1
0
forked from aniani/vim

patch 9.0.0822: crash when dragging the statusline with a mapping

Problem:    Crash when dragging the statusline with a mapping.
Solution:   Check for valid window pointer. (issue #11427)
This commit is contained in:
Bram Moolenaar
2022-10-31 13:06:26 +00:00
parent 86e6717ace
commit 8ab9ca93ee
5 changed files with 44 additions and 10 deletions

View File

@@ -1648,6 +1648,24 @@ func Test_mouse_drag_mapped_start_select()
set mouse&
endfunc
func Test_mouse_drag_statusline()
set laststatus=2
set mouse=a
func ClickExpr()
call test_setmouse(&lines - 1, 1)
return "\<LeftMouse>"
endfunc
func DragExpr()
call test_setmouse(&lines - 2, 1)
return "\<LeftDrag>"
endfunc
nnoremap <expr> <F2> ClickExpr()
nnoremap <expr> <F3> DragExpr()
" this was causing a crash in win_drag_status_line()
call feedkeys("\<F2>:tabnew\<CR>\<F3>", 'tx')
endfunc
" Test for mapping <LeftDrag> in Insert mode
func Test_mouse_drag_insert_map()
set mouse=a