mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0259: crash with mouse click when not initialized
Problem: Crash with mouse click when not initialized. Solution: Check TabPageIdxs[] is not NULL.
This commit is contained in:
@@ -471,6 +471,8 @@ do_mouse(
|
|||||||
|
|
||||||
start_visual.lnum = 0;
|
start_visual.lnum = 0;
|
||||||
|
|
||||||
|
if (TabPageIdxs != NULL) // only when initialized
|
||||||
|
{
|
||||||
// Check for clicking in the tab page line.
|
// Check for clicking in the tab page line.
|
||||||
if (mouse_row == 0 && firstwin->w_winrow > 0)
|
if (mouse_row == 0 && firstwin->w_winrow > 0)
|
||||||
{
|
{
|
||||||
@@ -540,6 +542,7 @@ do_mouse(
|
|||||||
tabpage_move(c1 <= 0 ? 9999 : c1 - 1);
|
tabpage_move(c1 <= 0 ? 9999 : c1 - 1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
|
// When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
|
||||||
// right button up -> pop-up menu
|
// right button up -> pop-up menu
|
||||||
|
@@ -147,4 +147,18 @@ func Test_tabline_20_format_items_no_overrun()
|
|||||||
set showtabline& tabline&
|
set showtabline& tabline&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_mouse_click_in_tab()
|
||||||
|
" This used to crash because TabPageIdxs[] was not initialized
|
||||||
|
let lines =<< trim END
|
||||||
|
tabnew
|
||||||
|
set mouse=a
|
||||||
|
exe "norm \<LeftMouse>"
|
||||||
|
END
|
||||||
|
call writefile(lines, 'Xclickscript')
|
||||||
|
call RunVim([], [], "-e -s -S Xclickscript -c qa")
|
||||||
|
|
||||||
|
call delete('Xclickscript')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -731,6 +731,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
259,
|
||||||
/**/
|
/**/
|
||||||
258,
|
258,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user