diff options
Diffstat (limited to 'src/testdir/test_termcodes.vim')
-rw-r--r-- | src/testdir/test_termcodes.vim | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 949fa9481..9a8fe155f 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -165,7 +165,8 @@ func Test_xterm_mouse_drag_statusline() let save_mouse = &mouse let save_term = &term let save_ttymouse = &ttymouse - set mouse=a term=xterm + let save_laststatus = &laststatus + set mouse=a term=xterm laststatus=2 for ttymouse_val in ['xterm', 'sgr'] exe 'set ttymouse=' . ttymouse_val @@ -197,4 +198,51 @@ func Test_xterm_mouse_drag_statusline() let &mouse = save_mouse let &term = save_term let &ttymouse = save_ttymouse + let &laststatus = save_laststatus +endfunc + +func Test_xterm_mouse_click_tab() + let save_mouse = &mouse + let save_term = &term + let save_ttymouse = &ttymouse + set mouse=a term=xterm + let row = 1 + + for ttymouse_val in ['xterm', 'sgr'] + exe 'set ttymouse=' . ttymouse_val + e Xfoo + tabnew Xbar + + let a = split(execute(':tabs'), "\n") + call assert_equal(['Tab page 1', + \ ' Xfoo', + \ 'Tab page 2', + \ '> Xbar'], a) + + " Test clicking on tab names in the tabline at the top. + let col = 2 + redraw! + call MouseLeftClick(row, col) + call MouseLeftRelease(row, col) + let a = split(execute(':tabs'), "\n") + call assert_equal(['Tab page 1', + \ '> Xfoo', + \ 'Tab page 2', + \ ' Xbar'], a) + + let col = 9 + call MouseLeftClick(row, col) + call MouseLeftRelease(row, col) + let a = split(execute(':tabs'), "\n") + call assert_equal(['Tab page 1', + \ ' Xfoo', + \ 'Tab page 2', + \ '> Xbar'], a) + + %bwipe! + endfor + + let &mouse = save_mouse + let &term = save_term + let &ttymouse = save_ttymouse endfunc |