mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.1244: no tests for CTRL-mouse-click
Problem: No tests for CTRL-mouse-click.
Solution: Add a few tests. (Dominique Pelle, closes vim/vim#4323)
1ee36d6ff5
Use usr_toc.txt instead of help.txt.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
2a84e20ff5
commit
458633071a
@ -18,7 +18,7 @@ func Test_xterm_mouse_left_click()
|
|||||||
call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
|
call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer'])
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
go
|
go
|
||||||
call assert_equal([0, 1, 1, 0], getpos('.'), msg)
|
call assert_equal([0, 1, 1, 0], getpos('.'), msg)
|
||||||
let row = 2
|
let row = 2
|
||||||
@ -34,6 +34,42 @@ func Test_xterm_mouse_left_click()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test that <C-LeftMouse> jumps to help tag and <C-RightMouse> jumps back.
|
||||||
|
func Test_xterm_mouse_ctrl_click()
|
||||||
|
let save_mouse = &mouse
|
||||||
|
let save_term = &term
|
||||||
|
" let save_ttymouse = &ttymouse
|
||||||
|
" set mouse=a term=xterm
|
||||||
|
set mouse=a
|
||||||
|
|
||||||
|
for ttymouse_val in ['sgr']
|
||||||
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
|
" help
|
||||||
|
help usr_toc.txt
|
||||||
|
/usr_02.txt
|
||||||
|
norm! zt
|
||||||
|
let row = 1
|
||||||
|
let col = 1
|
||||||
|
call MouseCtrlLeftClick(row, col)
|
||||||
|
call MouseLeftRelease(row, col)
|
||||||
|
call assert_match('usr_02.txt$', bufname('%'), msg)
|
||||||
|
call assert_equal('*usr_02.txt*', expand('<cWORD>'))
|
||||||
|
|
||||||
|
call MouseCtrlRightClick(row, col)
|
||||||
|
call MouseLeftRelease(row, col)
|
||||||
|
" call assert_match('help.txt$', bufname('%'), msg)
|
||||||
|
call assert_match('usr_toc.txt$', bufname('%'), msg)
|
||||||
|
call assert_equal('|usr_02.txt|', expand('<cWORD>'))
|
||||||
|
|
||||||
|
helpclose
|
||||||
|
endfor
|
||||||
|
|
||||||
|
let &mouse = save_mouse
|
||||||
|
" let &term = save_term
|
||||||
|
" let &ttymouse = save_ttymouse
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_xterm_mouse_middle_click()
|
func Test_xterm_mouse_middle_click()
|
||||||
CheckFeature clipboard_working
|
CheckFeature clipboard_working
|
||||||
|
|
||||||
@ -48,7 +84,7 @@ func Test_xterm_mouse_middle_click()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
call setline(1, ['123456789', '123456789'])
|
call setline(1, ['123456789', '123456789'])
|
||||||
|
|
||||||
" Middle-click in the middle of the line pastes text where clicked.
|
" Middle-click in the middle of the line pastes text where clicked.
|
||||||
@ -90,7 +126,7 @@ func Test_xterm_mouse_wheel()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
go
|
go
|
||||||
call assert_equal(1, line('w0'), msg)
|
call assert_equal(1, line('w0'), msg)
|
||||||
call assert_equal([0, 1, 1, 0], getpos('.'), msg)
|
call assert_equal([0, 1, 1, 0], getpos('.'), msg)
|
||||||
@ -127,7 +163,7 @@ func Test_xterm_mouse_drag_window_separator()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
|
|
||||||
" Split horizontally and test dragging the horizontal window separator.
|
" Split horizontally and test dragging the horizontal window separator.
|
||||||
split
|
split
|
||||||
@ -185,7 +221,7 @@ func Test_xterm_mouse_drag_statusline()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
|
|
||||||
call assert_equal(1, &cmdheight, msg)
|
call assert_equal(1, &cmdheight, msg)
|
||||||
let rowstatusline = winheight(0) + 1
|
let rowstatusline = winheight(0) + 1
|
||||||
@ -227,7 +263,7 @@ func Test_xterm_mouse_click_tab()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
e Xfoo
|
e Xfoo
|
||||||
tabnew Xbar
|
tabnew Xbar
|
||||||
|
|
||||||
@ -280,7 +316,7 @@ func Test_xterm_mouse_click_X_to_close_tab()
|
|||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
e Xtab1
|
e Xtab1
|
||||||
tabnew Xtab2
|
tabnew Xtab2
|
||||||
tabnew Xtab3
|
tabnew Xtab3
|
||||||
@ -323,7 +359,7 @@ func Test_xterm_mouse_drag_to_move_tab()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
e Xtab1
|
e Xtab1
|
||||||
tabnew Xtab2
|
tabnew Xtab2
|
||||||
|
|
||||||
@ -373,7 +409,7 @@ func Test_xterm_mouse_double_click_to_create_tab()
|
|||||||
|
|
||||||
for ttymouse_val in ['sgr']
|
for ttymouse_val in ['sgr']
|
||||||
let msg = 'ttymouse=' .. ttymouse_val
|
let msg = 'ttymouse=' .. ttymouse_val
|
||||||
" exe 'set ttymouse=' . ttymouse_val
|
" exe 'set ttymouse=' .. ttymouse_val
|
||||||
e Xtab1
|
e Xtab1
|
||||||
tabnew Xtab2
|
tabnew Xtab2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user