1
0
forked from aniani/vim

patch 8.1.1165: no test for mouse clicks in the terminal tabpage line

Problem:    No test for mouse clicks in the terminal tabpage line.
Solution:   Add a test. (Dominique Pelle, closes #4247).  Also init
            TabPageIdxs[], in case it's used before a redraw.
This commit is contained in:
Bram Moolenaar
2019-04-13 14:53:16 +02:00
parent 700dfaa86a
commit ca57ab54d7
3 changed files with 65 additions and 6 deletions

View File

@@ -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
@@ -194,6 +195,53 @@ func Test_xterm_mouse_drag_statusline()
call assert_equal(rowstatusline, winheight(0) + 1)
endfor
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