Mercurial > vim
annotate src/testdir/test_termcodes.vim @ 31129:9cc7b2cec8ad v9.0.0899
patch 9.0.0899: the builtin terminals are in one long list
Commit: https://github.com/vim/vim/commit/4654d63dec03650825875006c06bb0b0ae43283f
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 17 22:05:12 2022 +0000
patch 9.0.0899: the builtin terminals are in one long list
Problem: The builtin terminals are in one long list.
Solution: Refactor into multiple lists and an index of the lists.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Nov 2022 23:15:02 +0100 |
parents | c74358443098 |
children | d26436d305cc |
rev | line source |
---|---|
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Tests for decoding escape sequences sent by the terminal. |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 " This only works for Unix in a terminal |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
4 source check.vim |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
5 CheckNotGui |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
6 CheckUnix |
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 |
16437
fbc0b3b38c79
patch 8.1.1223: middle mouse click test fails without a clipboard
Bram Moolenaar <Bram@vim.org>
parents:
16423
diff
changeset
|
8 source shared.vim |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
9 source mouse.vim |
21624
1d75baa22d9a
patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message
Bram Moolenaar <Bram@vim.org>
parents:
21369
diff
changeset
|
10 source view_util.vim |
21626
ebceee9391cf
patch 8.2.1363: test trying to run terminal when it is not supported
Bram Moolenaar <Bram@vim.org>
parents:
21624
diff
changeset
|
11 source term_util.vim |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
12 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
13 func Test_term_mouse_left_click() |
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 new |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 let save_mouse = &mouse |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 let save_term = &term |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
18 call test_override('no_query_mouse', 1) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
19 set mouse=a term=xterm |
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 call setline(1, ['line 1', 'line 2', 'line 3 is a bit longer']) |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
22 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
23 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
24 exe 'set ttymouse=' .. ttymouse_val |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
25 go |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
26 call assert_equal([0, 1, 1, 0], getpos('.'), msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
27 let row = 2 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
28 let col = 6 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
29 call MouseLeftClick(row, col) |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
30 call MouseLeftRelease(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
31 call assert_equal([0, 2, 6, 0], getpos('.'), msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
32 endfor |
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 let &mouse = save_mouse |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 let &term = save_term |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
37 call test_override('no_query_mouse', 0) |
16263
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 bwipe! |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 endfunc |
d3377393e3d9
patch 8.1.1136: decoding of mouse click escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 |
18307
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
41 func Test_xterm_mouse_right_click_extends_visual() |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
42 if has('mac') |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
43 throw "Skipped: test right click in visual mode does not work on macOs (why?)" |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
44 endif |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
45 let save_mouse = &mouse |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
46 let save_term = &term |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
47 let save_ttymouse = &ttymouse |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
48 call test_override('no_query_mouse', 1) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
49 set mouse=a term=xterm |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
50 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
51 for visual_mode in ["v", "V", "\<C-V>"] |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
52 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
18307
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
53 let msg = 'visual=' .. visual_mode .. ' ttymouse=' .. ttymouse_val |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
54 exe 'set ttymouse=' .. ttymouse_val |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
55 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
56 call setline(1, repeat([repeat('-', 7)], 7)) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
57 call MouseLeftClick(4, 4) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
58 call MouseLeftRelease(4, 4) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
59 exe "norm! " .. visual_mode |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
60 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
61 " Right click extends top left of visual area. |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
62 call MouseRightClick(2, 2) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
63 call MouseRightRelease(2, 2) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
64 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
65 " Right click extends bottom right of visual area. |
18307
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
66 call MouseRightClick(6, 6) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
67 call MouseRightRelease(6, 6) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
68 norm! r1gv |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
69 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
70 " Right click shrinks top left of visual area. |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
71 call MouseRightClick(3, 3) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
72 call MouseRightRelease(3, 3) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
73 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
74 " Right click shrinks bottom right of visual area. |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
75 call MouseRightClick(5, 5) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
76 call MouseRightRelease(5, 5) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
77 norm! r2 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
78 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
79 if visual_mode ==# 'v' |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
80 call assert_equal(['-------', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
81 \ '-111111', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
82 \ '1122222', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
83 \ '2222222', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
84 \ '2222211', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
85 \ '111111-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
86 \ '-------'], getline(1, '$'), msg) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
87 elseif visual_mode ==# 'V' |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
88 call assert_equal(['-------', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
89 \ '1111111', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
90 \ '2222222', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
91 \ '2222222', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
92 \ '2222222', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
93 \ '1111111', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
94 \ '-------'], getline(1, '$'), msg) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
95 else |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
96 call assert_equal(['-------', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
97 \ '-11111-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
98 \ '-12221-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
99 \ '-12221-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
100 \ '-12221-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
101 \ '-11111-', |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
102 \ '-------'], getline(1, '$'), msg) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
103 endif |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
104 endfor |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
105 endfor |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
106 |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
107 let &mouse = save_mouse |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
108 let &term = save_term |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
109 let &ttymouse = save_ttymouse |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
110 call test_override('no_query_mouse', 0) |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
111 bwipe! |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
112 endfunc |
176fa195b95d
patch 8.1.2148: no test for right click extending Visual area
Bram Moolenaar <Bram@vim.org>
parents:
18301
diff
changeset
|
113 |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
114 " Test that <C-LeftMouse> jumps to help tag and <C-RightMouse> jumps back. |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
115 " Also test for g<LeftMouse> and g<RightMouse>. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
116 func Test_xterm_mouse_tagjump() |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
117 let save_mouse = &mouse |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
118 let save_term = &term |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
119 let save_ttymouse = &ttymouse |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
120 set mouse=a term=xterm |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
121 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
122 for ttymouse_val in g:Ttymouse_values |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
123 let msg = 'ttymouse=' .. ttymouse_val |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
124 exe 'set ttymouse=' .. ttymouse_val |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
125 help |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
126 /usr_02.txt |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
127 norm! zt |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
128 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
129 " CTRL-left click to jump to a tag |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
130 let row = 1 |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
131 let col = 1 |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
132 call MouseCtrlLeftClick(row, col) |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
133 call MouseLeftRelease(row, col) |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
134 call assert_match('usr_02.txt$', bufname('%'), msg) |
18223
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
135 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg) |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
136 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
137 " CTRL-right click to pop a tag |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
138 call MouseCtrlRightClick(row, col) |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
139 call MouseRightRelease(row, col) |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
140 call assert_match('help.txt$', bufname('%'), msg) |
18223
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
141 call assert_equal('|usr_02.txt|', expand('<cWORD>'), msg) |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
142 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
143 " Jump to a tag |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
144 exe "normal \<C-]>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
145 call assert_match('usr_02.txt$', bufname('%'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
146 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
147 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
148 " Use CTRL-right click in insert mode to pop the tag |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
149 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
150 let str = 'iHello' .. MouseCtrlRightClickCode(row, col) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
151 \ .. MouseRightReleaseCode(row, col) .. "\<C-C>" |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
152 call assert_fails('call feedkeys(str, "Lx!")', 'E37:', msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
153 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
154 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
155 " CTRL-right click with a count |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
156 let str = "4" .. MouseCtrlRightClickCode(row, col) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
157 \ .. MouseRightReleaseCode(row, col) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
158 call assert_fails('call feedkeys(str, "Lx!")', 'E555:', msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
159 call assert_match('help.txt$', bufname('%'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
160 call assert_equal(1, line('.'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
161 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
162 " g<LeftMouse> to jump to a tag |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
163 /usr_02.txt |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
164 norm! zt |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
165 call test_setmouse(row, col) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
166 exe "normal g\<LeftMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
167 call assert_match('usr_02.txt$', bufname('%'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
168 call assert_equal('*usr_02.txt*', expand('<cWORD>'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
169 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
170 " g<RightMouse> to pop to a tag |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
171 call test_setmouse(row, col) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
172 exe "normal g\<RightMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
173 call assert_match('help.txt$', bufname('%'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
174 call assert_equal('|usr_02.txt|', expand('<cWORD>'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
175 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
176 %bw! |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
177 endfor |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
178 |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
179 let &mouse = save_mouse |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
180 let &term = save_term |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
181 let &ttymouse = save_ttymouse |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
182 endfunc |
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
183 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
184 func Test_term_mouse_middle_click() |
17686
853afcc375b2
patch 8.1.1840: Testing: WorkingClipboard() is not accurate
Bram Moolenaar <Bram@vim.org>
parents:
17657
diff
changeset
|
185 CheckFeature clipboard_working |
16437
fbc0b3b38c79
patch 8.1.1223: middle mouse click test fails without a clipboard
Bram Moolenaar <Bram@vim.org>
parents:
16423
diff
changeset
|
186 |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
187 new |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
188 let save_mouse = &mouse |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
189 let save_term = &term |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
190 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
191 call test_override('no_query_mouse', 1) |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
192 let save_quotestar = @* |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
193 let save_quoteplus = @+ |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
194 set mouse=a term=xterm |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
195 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
196 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
197 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
198 exe 'set ttymouse=' .. ttymouse_val |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
199 call setline(1, ['123456789', '123456789']) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
200 let @* = 'abc' |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
201 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
202 " Middle-click in the middle of the line pastes text where clicked. |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
203 let row = 1 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
204 let col = 6 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
205 call MouseMiddleClick(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
206 call MouseMiddleRelease(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
207 call assert_equal(['12345abc6789', '123456789'], getline(1, '$'), msg) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
208 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
209 " Middle-click beyond end of the line pastes text at the end of the line. |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
210 let col = 20 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
211 call MouseMiddleClick(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
212 call MouseMiddleRelease(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
213 call assert_equal(['12345abc6789abc', '123456789'], getline(1, '$'), msg) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
214 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
215 " Middle-click beyond the last line pastes in the last line. |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
216 let row = 5 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
217 let col = 3 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
218 call MouseMiddleClick(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
219 call MouseMiddleRelease(row, col) |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
220 call assert_equal(['12345abc6789abc', '12abc3456789'], getline(1, '$'), msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
221 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
222 " Middle mouse click in operator pending mode beeps |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
223 call assert_beeps('exe "normal c\<MiddleMouse>"') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
224 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
225 " Clicking middle mouse in visual mode, yanks the selection and pastes the |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
226 " clipboard contents |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
227 let save_clipboard = &clipboard |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
228 set clipboard= |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
229 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
230 call cursor(1, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
231 call feedkeys("v3l" .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
232 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7), 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
233 call assert_equal(['12345abc6789abc', '12abc3abc456789'], |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
234 \ getline(1, '$'), msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
235 call assert_equal('1234', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
236 let &clipboard = save_clipboard |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
237 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
238 " Clicking middle mouse in select mode, replaces the selected text with |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
239 " the clipboard contents |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
240 let @+ = 'xyz' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
241 call cursor(1, 3) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
242 exe "normal gh\<Right>\<Right>\<MiddleMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
243 call assert_equal(['12xyzabc6789abc', '12abc3abc456789'], |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
244 \ getline(1, '$'), msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
245 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
246 " Prefixing middle click with [ or ] fixes the indent after pasting. |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
247 %d |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
248 call setline(1, " one two") |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
249 call setreg('r', 'red blue', 'l') |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
250 call test_setmouse(1, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
251 exe "normal \"r[\<MiddleMouse>" |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
252 call assert_equal(' red blue', getline(1), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
253 call test_setmouse(2, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
254 exe "normal \"r]\<MiddleMouse>" |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
255 call assert_equal(' red blue', getline(3), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
256 %d |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
257 endfor |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
258 |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
259 let &mouse = save_mouse |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
260 let &term = save_term |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
261 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
262 call test_override('no_query_mouse', 0) |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
263 let @* = save_quotestar |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
264 let @+ = save_quotestar |
16423
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
265 bwipe! |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
266 endfunc |
4182fa3b9f70
patch 8.1.1216: mouse middle click is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16352
diff
changeset
|
267 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
268 " If clipboard is not working, then clicking the middle mouse button in visual |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
269 " mode, will copy and paste the selected text. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
270 func Test_term_mouse_middle_click_no_clipboard() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
271 if has('clipboard_working') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
272 throw 'Skipped: clipboard support works' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
273 endif |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
274 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
275 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
276 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
277 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
278 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
279 set mouse=a term=xterm |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
280 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
281 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
282 let msg = 'ttymouse=' .. ttymouse_val |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
283 exe 'set ttymouse=' .. ttymouse_val |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
284 call setline(1, ['123456789', '123456789']) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
285 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
286 " Clicking middle mouse in visual mode, yanks the selection and pastes it |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
287 call cursor(1, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
288 call feedkeys("v3l" .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
289 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7), 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
290 call assert_equal(['123456789', '1234561234789'], |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
291 \ getline(1, '$'), msg) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
292 endfor |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
293 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
294 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
295 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
296 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
297 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
298 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
299 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
300 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
301 func Test_term_mouse_middle_click_insert_mode() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
302 CheckFeature clipboard_working |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
303 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
304 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
305 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
306 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
307 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
308 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
309 set mouse=a term=xterm |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
310 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
311 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
312 let msg = 'ttymouse=' .. ttymouse_val |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
313 exe 'set ttymouse=' .. ttymouse_val |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
314 call setline(1, ['123456789', '123456789']) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
315 let @* = 'abc' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
316 |
26211
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
25429
diff
changeset
|
317 " Middle-click in insert mode doesn't move the cursor but inserts the |
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
25429
diff
changeset
|
318 " contents of a register |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
319 call cursor(1, 4) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
320 call feedkeys('i' .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
321 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
322 \ "\<C-C>", 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
323 call assert_equal(['123abc456789', '123456789'], |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
324 \ getline(1, '$'), msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
325 call assert_equal([1, 6], [line('.'), col('.')], msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
326 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
327 " Middle-click in replace mode |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
328 call cursor(1, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
329 call feedkeys('$R' .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
330 \ MouseMiddleClickCode(2, 7) .. MouseMiddleReleaseCode(2, 7) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
331 \ "\<C-C>", 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
332 call assert_equal(['123abc45678abc', '123456789'], |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
333 \ getline(1, '$'), msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
334 call assert_equal([1, 14], [line('.'), col('.')], msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
335 endfor |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
336 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
337 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
338 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
339 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
340 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
341 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
342 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
343 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
344 " Test for switching window using mouse in insert mode |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
345 func Test_term_mouse_switch_win_insert_mode() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
346 5new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
347 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
348 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
349 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
350 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
351 set mouse=a term=xterm ttymouse=xterm2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
352 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
353 call feedkeys('ivim' .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
354 \ MouseLeftClickCode(8, 6) .. MouseLeftReleaseCode(8, 6) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
355 \ "\<C-C>", 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
356 call assert_equal(2, winnr()) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
357 wincmd w |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
358 call assert_equal('n', mode()) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
359 call assert_equal(['vim'], getline(1, '$')) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
360 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
361 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
362 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
363 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
364 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
365 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
366 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
367 |
26211
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
25429
diff
changeset
|
368 " Test for using the mouse to increase the height of the cmdline window |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
369 func Test_mouse_cmdwin_resize() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
370 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
371 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
372 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
373 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
374 set mouse=a term=xterm ttymouse=xterm2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
375 5new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
376 redraw! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
377 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
378 let h = 0 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
379 let row = &lines - &cmdwinheight - 2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
380 call feedkeys("q:" .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
381 \ MouseLeftClickCode(row, 1) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
382 \ MouseLeftDragCode(row - 1, 1) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
383 \ MouseLeftReleaseCode(row - 2, 1) .. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
384 \ "alet h = \<C-R>=winheight(0)\<CR>\<CR>", 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
385 call assert_equal(&cmdwinheight + 2, h) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
386 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
387 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
388 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
389 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
390 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
391 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
392 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
393 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
394 " TODO: for unclear reasons this test fails if it comes after |
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
395 " Test_xterm_mouse_ctrl_click() |
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
396 func Test_1xterm_mouse_wheel() |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
397 new |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
398 let save_mouse = &mouse |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
399 let save_term = &term |
21114
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
400 let save_wrap = &wrap |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
401 let save_ttymouse = &ttymouse |
21114
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
402 set mouse=a term=xterm nowrap |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
403 call setline(1, range(100000000000000, 100000000000100)) |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
404 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
405 for ttymouse_val in g:Ttymouse_values |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
406 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
407 exe 'set ttymouse=' .. ttymouse_val |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
408 go |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
409 call assert_equal(1, line('w0'), msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
410 call assert_equal([0, 1, 1, 0], getpos('.'), msg) |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
411 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
412 call MouseWheelDown(1, 1) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
413 call assert_equal(4, line('w0'), msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
414 call assert_equal([0, 4, 1, 0], getpos('.'), msg) |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
415 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
416 call MouseWheelDown(1, 1) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
417 call assert_equal(7, line('w0'), msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
418 call assert_equal([0, 7, 1, 0], getpos('.'), msg) |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
419 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
420 call MouseWheelUp(1, 1) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
421 call assert_equal(4, line('w0'), msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
422 call assert_equal([0, 7, 1, 0], getpos('.'), msg) |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
423 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
424 call MouseWheelUp(1, 1) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
425 call assert_equal(1, line('w0'), msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
426 call assert_equal([0, 7, 1, 0], getpos('.'), msg) |
21114
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
427 |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
428 if has('gui') |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
429 " Horizontal wheel scrolling currently only works when vim is |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
430 " compiled with gui enabled. |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
431 call MouseWheelRight(1, 1) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
432 call assert_equal(7, 1 + virtcol(".") - wincol(), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
433 call assert_equal([0, 7, 7, 0], getpos('.'), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
434 |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
435 call MouseWheelRight(1, 1) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
436 call assert_equal(13, 1 + virtcol(".") - wincol(), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
437 call assert_equal([0, 7, 13, 0], getpos('.'), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
438 |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
439 call MouseWheelLeft(1, 1) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
440 call assert_equal(7, 1 + virtcol(".") - wincol(), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
441 call assert_equal([0, 7, 13, 0], getpos('.'), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
442 |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
443 call MouseWheelLeft(1, 1) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
444 call assert_equal(1, 1 + virtcol(".") - wincol(), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
445 call assert_equal([0, 7, 13, 0], getpos('.'), msg) |
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
446 endif |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
447 endfor |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
448 |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
449 let &mouse = save_mouse |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
450 let &term = save_term |
21114
d0265fdadec9
patch 8.2.1108: mouse left-right scroll is not supported in terminal window
Bram Moolenaar <Bram@vim.org>
parents:
20850
diff
changeset
|
451 let &wrap = save_wrap |
16265
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
452 let &ttymouse = save_ttymouse |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
453 bwipe! |
7feb5b90be5f
patch 8.1.1137: xterm mouse wheel escape sequence is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16263
diff
changeset
|
454 endfunc |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
455 |
18223
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
456 " Test that dragging beyond the window (at the bottom and at the top) |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
457 " scrolls window content by the number of lines beyond the window. |
18223
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
458 func Test_term_mouse_drag_beyond_window() |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
459 let save_mouse = &mouse |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
460 let save_term = &term |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
461 let save_ttymouse = &ttymouse |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
462 call test_override('no_query_mouse', 1) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
463 set mouse=a term=xterm |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
464 let col = 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
465 call setline(1, range(1, 100)) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
466 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
467 " Split into 3 windows, and go into the middle window |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
468 " so we test dragging mouse below and above the window. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
469 2split |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
470 wincmd j |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
471 2split |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
472 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
473 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
18223
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
474 let msg = 'ttymouse=' .. ttymouse_val |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
475 exe 'set ttymouse=' .. ttymouse_val |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
476 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
477 " Line #10 at the top. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
478 norm! 10zt |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
479 redraw |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
480 call assert_equal(10, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
481 call assert_equal(2, winheight(0), msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
482 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
483 let row = 4 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
484 call MouseLeftClick(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
485 call assert_equal(10, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
486 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
487 " Drag downwards. We're still in the window so topline should |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
488 " not change yet. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
489 let row += 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
490 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
491 call assert_equal(10, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
492 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
493 " We now leave the window at the bottom, so the window content should |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
494 " scroll by 1 line, then 2 lines (etc) as we drag further away. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
495 let row += 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
496 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
497 call assert_equal(11, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
498 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
499 let row += 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
500 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
501 call assert_equal(13, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
502 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
503 " Now drag upwards. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
504 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
505 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
506 call assert_equal(14, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
507 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
508 " We're now back in the window so the topline should not change. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
509 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
510 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
511 call assert_equal(14, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
512 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
513 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
514 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
515 call assert_equal(14, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
516 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
517 " We now leave the window at the top so the window content should |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
518 " scroll by 1 line, then 2, then 3 (etc) in the opposite direction. |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
519 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
520 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
521 call assert_equal(13, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
522 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
523 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
524 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
525 call assert_equal(11, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
526 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
527 let row -= 1 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
528 call MouseLeftDrag(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
529 call assert_equal(8, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
530 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
531 call MouseLeftRelease(row, col) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
532 call assert_equal(8, winsaveview().topline, msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
533 call assert_equal(2, winheight(0), msg) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
534 endfor |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
535 |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
536 let &mouse = save_mouse |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
537 let &term = save_term |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
538 let &ttymouse = save_ttymouse |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
539 call test_override('no_query_mouse', 0) |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
540 bwipe! |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
541 endfunc |
8a86e518fa42
patch 8.1.2106: no tests for dragging the mouse beyond the window
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
542 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
543 func Test_term_mouse_drag_window_separator() |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
544 let save_mouse = &mouse |
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
545 let save_term = &term |
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
546 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
547 call test_override('no_query_mouse', 1) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
548 set mouse=a term=xterm |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
549 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
550 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
551 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
552 exe 'set ttymouse=' .. ttymouse_val |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
553 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
554 " Split horizontally and test dragging the horizontal window separator. |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
555 split |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
556 let rowseparator = winheight(0) + 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
557 let row = rowseparator |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
558 let col = 1 |
16310
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
559 |
16352
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
560 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. |
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
561 if ttymouse_val !=# 'xterm2' || row <= 223 |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
562 call MouseLeftClick(row, col) |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
563 let row -= 1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
564 call MouseLeftDrag(row, col) |
30980
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
565 call assert_equal(rowseparator - 1, winheight(0) + 1, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
566 let row += 1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
567 call MouseLeftDrag(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
568 call assert_equal(rowseparator, winheight(0) + 1, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
569 call MouseLeftRelease(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
570 call assert_equal(rowseparator, winheight(0) + 1, msg) |
16310
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
571 endif |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
572 bwipe! |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
573 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
574 " Split vertically and test dragging the vertical window separator. |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
575 vsplit |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
576 let colseparator = winwidth(0) + 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
577 let row = 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
578 let col = colseparator |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
579 |
16352
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
580 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. |
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
581 if ttymouse_val !=# 'xterm2' || col <= 223 |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
582 call MouseLeftClick(row, col) |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
583 let col -= 1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
584 call MouseLeftDrag(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
585 call assert_equal(colseparator - 1, winwidth(0) + 1, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
586 let col += 1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
587 call MouseLeftDrag(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
588 call assert_equal(colseparator, winwidth(0) + 1, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
589 call MouseLeftRelease(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
590 call assert_equal(colseparator, winwidth(0) + 1, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
591 endif |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
592 bwipe! |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
593 endfor |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
594 |
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
595 let &mouse = save_mouse |
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
596 let &term = save_term |
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
597 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
598 call test_override('no_query_mouse', 0) |
16275
ed5172ae1c32
patch 8.1.1142: no test for dragging the window separators with the mouse
Bram Moolenaar <Bram@vim.org>
parents:
16265
diff
changeset
|
599 endfunc |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
600 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
601 func Test_term_mouse_drag_statusline() |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
602 let save_mouse = &mouse |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
603 let save_term = &term |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
604 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
605 call test_override('no_query_mouse', 1) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
606 let save_laststatus = &laststatus |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
607 set mouse=a term=xterm laststatus=2 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
608 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
609 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
610 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
611 exe 'set ttymouse=' .. ttymouse_val |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
612 |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
613 call assert_equal(1, &cmdheight, msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
614 let rowstatusline = winheight(0) + 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
615 let row = rowstatusline |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
616 let col = 1 |
16310
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
617 |
16352
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
618 if ttymouse_val ==# 'xterm2' && row > 223 |
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
619 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. |
16310
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
620 continue |
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
621 endif |
5b8b849dc3aa
patch 8.1.1160: termcodes test would fail in a very big terminal
Bram Moolenaar <Bram@vim.org>
parents:
16300
diff
changeset
|
622 |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
623 call MouseLeftClick(row, col) |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
624 let row -= 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
625 call MouseLeftDrag(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
626 call assert_equal(2, &cmdheight, msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
627 call assert_equal(rowstatusline - 1, winheight(0) + 1, msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
628 let row += 1 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
629 call MouseLeftDrag(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
630 call assert_equal(1, &cmdheight, msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
631 call assert_equal(rowstatusline, winheight(0) + 1, msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
632 call MouseLeftRelease(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
633 call assert_equal(1, &cmdheight, msg) |
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
634 call assert_equal(rowstatusline, winheight(0) + 1, msg) |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
635 endfor |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
636 |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
637 let &mouse = save_mouse |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
638 let &term = save_term |
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
639 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
640 call test_override('no_query_mouse', 0) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
641 let &laststatus = save_laststatus |
16300
f3d579f009d1
patch 8.1.1155: termcodes tests can be improved
Bram Moolenaar <Bram@vim.org>
parents:
16275
diff
changeset
|
642 endfunc |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
643 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
644 func Test_term_mouse_click_tab() |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
645 let save_mouse = &mouse |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
646 let save_term = &term |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
647 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
648 call test_override('no_query_mouse', 1) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
649 set mouse=a term=xterm |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
650 let row = 1 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
651 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
652 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
653 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
654 exe 'set ttymouse=' .. ttymouse_val |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
655 e Xfoo |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
656 tabnew Xbar |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
657 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
658 let a = split(execute(':tabs'), "\n") |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
659 call assert_equal(['Tab page 1', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
660 \ ' Xfoo', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
661 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
662 \ '> Xbar'], a, msg) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
663 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
664 " Test clicking on tab names in the tabline at the top. |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
665 let col = 2 |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
666 redraw |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
667 call MouseLeftClick(row, col) |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
668 call MouseLeftRelease(row, col) |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
669 let a = split(execute(':tabs'), "\n") |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
670 call assert_equal(['Tab page 1', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
671 \ '> Xfoo', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
672 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
673 \ ' Xbar'], a, msg) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
674 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
675 let col = 9 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
676 call MouseLeftClick(row, col) |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
677 call MouseLeftRelease(row, col) |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
678 let a = split(execute(':tabs'), "\n") |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
679 call assert_equal(['Tab page 1', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
680 \ ' Xfoo', |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
681 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
682 \ '> Xbar'], a, msg) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
683 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
684 %bwipe! |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
685 endfor |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
686 |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
687 let &mouse = save_mouse |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
688 let &term = save_term |
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
689 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
690 call test_override('no_query_mouse', 0) |
16320
57e0f6b4a87d
patch 8.1.1165: no test for mouse clicks in the terminal tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
16310
diff
changeset
|
691 endfunc |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
692 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
693 func Test_term_mouse_click_X_to_close_tab() |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
694 let save_mouse = &mouse |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
695 let save_term = &term |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
696 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
697 call test_override('no_query_mouse', 1) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
698 set mouse=a term=xterm |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
699 let row = 1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
700 let col = &columns |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
701 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
702 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm |
16352
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
703 if ttymouse_val ==# 'xterm2' && col > 223 |
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
704 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
705 continue |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
706 endif |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
707 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
708 exe 'set ttymouse=' .. ttymouse_val |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
709 e Xtab1 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
710 tabnew Xtab2 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
711 tabnew Xtab3 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
712 tabn 2 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
713 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
714 let a = split(execute(':tabs'), "\n") |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
715 call assert_equal(['Tab page 1', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
716 \ ' Xtab1', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
717 \ 'Tab page 2', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
718 \ '> Xtab2', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
719 \ 'Tab page 3', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
720 \ ' Xtab3'], a, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
721 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
722 " Click on "X" in tabline to close current tab i.e. Xtab2. |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
723 redraw |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
724 call MouseLeftClick(row, col) |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
725 call MouseLeftRelease(row, col) |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
726 let a = split(execute(':tabs'), "\n") |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
727 call assert_equal(['Tab page 1', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
728 \ ' Xtab1', |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
729 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
730 \ '> Xtab3'], a, msg) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
731 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
732 %bwipe! |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
733 endfor |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
734 |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
735 let &mouse = save_mouse |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
736 let &term = save_term |
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
737 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
738 call test_override('no_query_mouse', 0) |
16324
6b2412d0509f
patch 8.1.1167: no test for closing tab by click in tabline
Bram Moolenaar <Bram@vim.org>
parents:
16320
diff
changeset
|
739 endfunc |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
740 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
741 func Test_term_mouse_drag_to_move_tab() |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
742 let save_mouse = &mouse |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
743 let save_term = &term |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
744 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
745 call test_override('no_query_mouse', 1) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
746 " Set 'mousetime' to 1 to avoid recognizing a double-click in the loop |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
747 set mouse=a term=xterm mousetime=1 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
748 let row = 1 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
749 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
750 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
751 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
752 exe 'set ttymouse=' .. ttymouse_val |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
753 e Xtab1 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
754 tabnew Xtab2 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
755 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
756 let a = split(execute(':tabs'), "\n") |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
757 call assert_equal(['Tab page 1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
758 \ ' Xtab1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
759 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
760 \ '> Xtab2'], a, msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
761 redraw |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
762 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
763 " Click in tab2 and drag it to tab1. |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
764 " Check getcharmod() to verify that click is not |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
765 " interpreted as a spurious double-click. |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
766 call MouseLeftClick(row, 10) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
767 call assert_equal(0, getcharmod(), msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
768 for col in [9, 8, 7, 6] |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
769 call MouseLeftDrag(row, col) |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
770 endfor |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
771 call MouseLeftRelease(row, col) |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
772 let a = split(execute(':tabs'), "\n") |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
773 call assert_equal(['Tab page 1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
774 \ '> Xtab2', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
775 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
776 \ ' Xtab1'], a, msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
777 |
30980
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
778 " Switch to tab1 |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
779 tabnext |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
780 let a = split(execute(':tabs'), "\n") |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
781 call assert_equal(['Tab page 1', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
782 \ ' Xtab2', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
783 \ 'Tab page 2', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
784 \ '> Xtab1'], a, msg) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
785 |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
786 " Click in tab2 and drag it to tab1. |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
787 " This time it is non-current tab. |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
788 call MouseLeftClick(row, 6) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
789 call assert_equal(0, getcharmod(), msg) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
790 for col in [7, 8, 9, 10] |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
791 call MouseLeftDrag(row, col) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
792 endfor |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
793 call MouseLeftRelease(row, col) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
794 let a = split(execute(':tabs'), "\n") |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
795 call assert_equal(['Tab page 1', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
796 \ ' Xtab1', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
797 \ 'Tab page 2', |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
798 \ '> Xtab2'], a, msg) |
eb51299c4bfc
patch 9.0.0825: cannot drag an entry in the tabpage line
Bram Moolenaar <Bram@vim.org>
parents:
30976
diff
changeset
|
799 |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
800 " Click elsewhere so that click in next iteration is not |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
801 " interpreted as unwanted double-click. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
802 call MouseLeftClick(row, 11) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
803 call MouseLeftRelease(row, 11) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
804 |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
805 %bwipe! |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
806 endfor |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
807 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
808 let &mouse = save_mouse |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
809 let &term = save_term |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
810 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
811 call test_override('no_query_mouse', 0) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
812 set mousetime& |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
813 endfunc |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
814 |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
815 func Test_term_mouse_double_click_to_create_tab() |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
816 let save_mouse = &mouse |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
817 let save_term = &term |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
818 let save_ttymouse = &ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
819 call test_override('no_query_mouse', 1) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
820 " Set 'mousetime' to a small value, so that double-click works but we don't |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
821 " have to wait long to avoid a triple-click. |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
822 set mouse=a term=xterm mousetime=200 |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
823 let row = 1 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
824 let col = 10 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
825 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
826 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
827 let msg = 'ttymouse=' .. ttymouse_val |
16481
8428e0edba1b
patch 8.1.1244: no tests for CTRL-mouse-click
Bram Moolenaar <Bram@vim.org>
parents:
16437
diff
changeset
|
828 exe 'set ttymouse=' .. ttymouse_val |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
829 e Xtab1 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
830 tabnew Xtab2 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
831 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
832 let a = split(execute(':tabs'), "\n") |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
833 call assert_equal(['Tab page 1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
834 \ ' Xtab1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
835 \ 'Tab page 2', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
836 \ '> Xtab2'], a, msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
837 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
838 redraw |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
839 call MouseLeftClick(row, col) |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
840 " Check getcharmod() to verify that first click is not |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
841 " interpreted as a spurious double-click. |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
842 call assert_equal(0, getcharmod(), msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
843 call MouseLeftRelease(row, col) |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
844 call MouseLeftClick(row, col) |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
845 call assert_equal(32, getcharmod(), msg) " double-click |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
846 call MouseLeftRelease(row, col) |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
847 let a = split(execute(':tabs'), "\n") |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
848 call assert_equal(['Tab page 1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
849 \ ' Xtab1', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
850 \ 'Tab page 2', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
851 \ '> [No Name]', |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
852 \ 'Tab page 3', |
16346
2fb516abde42
patch 8.1.1178: when mouse click tests fails value of 'ttytype' is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16342
diff
changeset
|
853 \ ' Xtab2'], a, msg) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
854 |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
855 " Click elsewhere so that click in next iteration is not |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
856 " interpreted as unwanted double click. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
857 call MouseLeftClick(row, col + 1) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
858 call MouseLeftRelease(row, col + 1) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
859 |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
860 %bwipe! |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
861 endfor |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
862 |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
863 let &mouse = save_mouse |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
864 let &term = save_term |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
865 let &ttymouse = save_ttymouse |
16489
42910f306377
patch 8.1.1248: no test for dec mouse
Bram Moolenaar <Bram@vim.org>
parents:
16487
diff
changeset
|
866 call test_override('no_query_mouse', 0) |
16340
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
867 set mousetime& |
2f70fc41ff7e
patch 8.1.1175: no test for dragging a tab and double click for new tab
Bram Moolenaar <Bram@vim.org>
parents:
16324
diff
changeset
|
868 endfunc |
16348
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
869 |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
870 " Test double/triple/quadruple click in normal mode to visually select. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
871 func Test_term_mouse_multiple_clicks_to_visually_select() |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
872 let save_mouse = &mouse |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
873 let save_term = &term |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
874 let save_ttymouse = &ttymouse |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
875 call test_override('no_query_mouse', 1) |
23412
d2c23042bb0e
patch 8.2.2249: termcodes test is flaky when used over ssh
Bram Moolenaar <Bram@vim.org>
parents:
23076
diff
changeset
|
876 |
d2c23042bb0e
patch 8.2.2249: termcodes test is flaky when used over ssh
Bram Moolenaar <Bram@vim.org>
parents:
23076
diff
changeset
|
877 " 'mousetime' must be sufficiently large, or else the test is flaky when |
d2c23042bb0e
patch 8.2.2249: termcodes test is flaky when used over ssh
Bram Moolenaar <Bram@vim.org>
parents:
23076
diff
changeset
|
878 " using a ssh connection with X forwarding; i.e. ssh -X (issue #7563). |
d2c23042bb0e
patch 8.2.2249: termcodes test is flaky when used over ssh
Bram Moolenaar <Bram@vim.org>
parents:
23076
diff
changeset
|
879 set mouse=a term=xterm mousetime=600 |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
880 new |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
881 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
882 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
883 let msg = 'ttymouse=' .. ttymouse_val |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
884 exe 'set ttymouse=' .. ttymouse_val |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
885 call setline(1, ['foo [foo bar] foo', 'foo']) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
886 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
887 " Double-click on word should visually select the word. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
888 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
889 call assert_equal(0, getcharmod(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
890 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
891 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
892 call assert_equal(32, getcharmod(), msg) " double-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
893 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
894 call assert_equal('v', mode(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
895 norm! r1 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
896 call assert_equal(['111 [foo bar] foo', 'foo'], getline(1, '$'), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
897 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
898 " Double-click on opening square bracket should visually |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
899 " select the whole [foo bar]. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
900 call MouseLeftClick(1, 5) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
901 call assert_equal(0, getcharmod(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
902 call MouseLeftRelease(1, 5) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
903 call MouseLeftClick(1, 5) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
904 call assert_equal(32, getcharmod(), msg) " double-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
905 call MouseLeftRelease(1, 5) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
906 call assert_equal('v', mode(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
907 norm! r2 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
908 call assert_equal(['111 222222222 foo', 'foo'], getline(1, '$'), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
909 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
910 " Triple-click should visually select the whole line. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
911 call MouseLeftClick(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
912 call assert_equal(0, getcharmod(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
913 call MouseLeftRelease(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
914 call MouseLeftClick(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
915 call assert_equal(32, getcharmod(), msg) " double-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
916 call MouseLeftRelease(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
917 call MouseLeftClick(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
918 call assert_equal(64, getcharmod(), msg) " triple-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
919 call MouseLeftRelease(1, 3) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
920 call assert_equal('V', mode(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
921 norm! r3 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
922 call assert_equal(['33333333333333333', 'foo'], getline(1, '$'), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
923 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
924 " Quadruple-click should start visual block select. |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
925 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
926 call assert_equal(0, getcharmod(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
927 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
928 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
929 call assert_equal(32, getcharmod(), msg) " double-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
930 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
931 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
932 call assert_equal(64, getcharmod(), msg) " triple-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
933 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
934 call MouseLeftClick(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
935 call assert_equal(96, getcharmod(), msg) " quadruple-click |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
936 call MouseLeftRelease(1, 2) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
937 call assert_equal("\<c-v>", mode(), msg) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
938 norm! r4 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
939 call assert_equal(['34333333333333333', 'foo'], getline(1, '$'), msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
940 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
941 " Double-click on a space character should visually select all the |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
942 " consecutive space characters. |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
943 %d |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
944 call setline(1, ' one two') |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
945 call MouseLeftClick(1, 2) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
946 call MouseLeftRelease(1, 2) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
947 call MouseLeftClick(1, 2) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
948 call MouseLeftRelease(1, 2) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
949 call assert_equal('v', mode(), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
950 norm! r1 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
951 call assert_equal(['1111one two'], getline(1, '$'), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
952 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
953 " Double-click on a word with exclusive selection |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
954 set selection=exclusive |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
955 let @" = '' |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
956 call MouseLeftClick(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
957 call MouseLeftRelease(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
958 call MouseLeftClick(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
959 call MouseLeftRelease(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
960 norm! y |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
961 call assert_equal('two', @", msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
962 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
963 " Double click to select a block of text with exclusive selection |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
964 %d |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
965 call setline(1, 'one (two) three') |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
966 call MouseLeftClick(1, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
967 call MouseLeftRelease(1, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
968 call MouseLeftClick(1, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
969 call MouseLeftRelease(1, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
970 norm! y |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
971 call assert_equal(5, col("'<"), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
972 call assert_equal(10, col("'>"), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
973 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
974 call MouseLeftClick(1, 9) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
975 call MouseLeftRelease(1, 9) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
976 call MouseLeftClick(1, 9) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
977 call MouseLeftRelease(1, 9) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
978 norm! y |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
979 call assert_equal(5, col("'<"), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
980 call assert_equal(10, col("'>"), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
981 set selection& |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
982 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
983 " Click somewhere else so that the clicks above is not combined with the |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
984 " clicks in the next iteration. |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
985 call MouseRightClick(3, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
986 call MouseRightRelease(3, 10) |
18627
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
987 endfor |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
988 |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
989 let &mouse = save_mouse |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
990 let &term = save_term |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
991 let &ttymouse = save_ttymouse |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
992 set mousetime& |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
993 call test_override('no_query_mouse', 0) |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
994 bwipe! |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
995 endfunc |
169c810d4e51
patch 8.1.2306: double and triple clicks are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18360
diff
changeset
|
996 |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
997 " Test for selecting text in visual blockwise mode using Alt-LeftClick |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
998 func Test_mouse_alt_leftclick() |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
999 let save_mouse = &mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1000 let save_term = &term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1001 let save_ttymouse = &ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1002 call test_override('no_query_mouse', 1) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1003 set mouse=a term=xterm mousetime=200 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1004 set mousemodel=popup |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1005 new |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1006 call setline(1, 'one (two) three') |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1007 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1008 for ttymouse_val in g:Ttymouse_values |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1009 let msg = 'ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1010 exe 'set ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1011 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1012 " Left click with the Alt modifier key should extend the selection in |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1013 " blockwise visual mode. |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1014 let @" = '' |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1015 call MouseLeftClick(1, 3) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1016 call MouseLeftRelease(1, 3) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1017 call MouseAltLeftClick(1, 11) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1018 call MouseLeftRelease(1, 11) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1019 call assert_equal("\<C-V>", mode(), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1020 normal! y |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1021 call assert_equal('e (two) t', @") |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1022 endfor |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1023 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1024 let &mouse = save_mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1025 let &term = save_term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1026 let &ttymouse = save_ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1027 set mousetime& mousemodel& |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1028 call test_override('no_query_mouse', 0) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1029 close! |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1030 endfunc |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1031 |
16348
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1032 func Test_xterm_mouse_click_in_fold_columns() |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1033 new |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1034 let save_mouse = &mouse |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1035 let save_term = &term |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1036 let save_ttymouse = &ttymouse |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1037 let save_foldcolumn = &foldcolumn |
16352
c742c008953e
patch 8.1.1181: tests for mouse clicks are a bit flaky
Bram Moolenaar <Bram@vim.org>
parents:
16348
diff
changeset
|
1038 set mouse=a term=xterm foldcolumn=3 ttymouse=xterm2 |
16348
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1039 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1040 " Create 2 nested folds. |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1041 call setline(1, range(1, 7)) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1042 2,6fold |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1043 norm! zR |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1044 4,5fold |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1045 call assert_equal([-1, -1, -1, 4, 4, -1, -1], |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1046 \ map(range(1, 7), 'foldclosed(v:val)')) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1047 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1048 " Click in "+" of inner fold in foldcolumn should open it. |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1049 redraw |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1050 let row = 4 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1051 let col = 2 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1052 call MouseLeftClick(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1053 call MouseLeftRelease(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1054 call assert_equal([-1, -1, -1, -1, -1, -1, -1], |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1055 \ map(range(1, 7), 'foldclosed(v:val)')) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1056 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1057 " Click in "-" of outer fold in foldcolumn should close it. |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1058 redraw |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1059 let row = 2 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1060 let col = 1 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1061 call MouseLeftClick(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1062 call MouseLeftRelease(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1063 call assert_equal([-1, 2, 2, 2, 2, 2, -1], |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1064 \ map(range(1, 7), 'foldclosed(v:val)')) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1065 norm! zR |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1066 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1067 " Click in "|" of inner fold in foldcolumn should close it. |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1068 redraw |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1069 let row = 5 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1070 let col = 2 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1071 call MouseLeftClick(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1072 call MouseLeftRelease(row, col) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1073 call assert_equal([-1, -1, -1, 4, 4, -1, -1], |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1074 \ map(range(1, 7), 'foldclosed(v:val)')) |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1075 |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1076 let &foldcolumn = save_foldcolumn |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1077 let &ttymouse = save_ttymouse |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1078 let &term = save_term |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1079 let &mouse = save_mouse |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1080 bwipe! |
5f3a86ba4261
patch 8.1.1179: no test for mouse clicks in the fold column
Bram Moolenaar <Bram@vim.org>
parents:
16346
diff
changeset
|
1081 endfunc |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1082 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1083 " Left or right click in Ex command line sets position of the cursor. |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1084 func Test_term_mouse_click_in_cmdline_to_set_pos() |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1085 let save_mouse = &mouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1086 let save_term = &term |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1087 let save_ttymouse = &ttymouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1088 call test_override('no_query_mouse', 1) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1089 set mouse=a term=xterm |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1090 let row = &lines |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1091 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
1092 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
19752
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1093 " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1094 if ttymouse_val !=# 'xterm2' || row <= 223 |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1095 let msg = 'ttymouse=' .. ttymouse_val |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1096 exe 'set ttymouse=' .. ttymouse_val |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1097 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1098 |
19752
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1099 call feedkeys(':"3456789' |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1100 \ .. MouseLeftClickCode(row, 7) |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1101 \ .. MouseLeftReleaseCode(row, 7) .. 'L' |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1102 \ .. MouseRightClickCode(row, 4) |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1103 \ .. MouseRightReleaseCode(row, 4) .. 'R' |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1104 \ .. "\<CR>", 'Lx!') |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1105 call assert_equal('"3R456L789', @:, msg) |
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
1106 endif |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1107 endfor |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1108 |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1109 let &mouse = save_mouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1110 let &term = save_term |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1111 let &ttymouse = save_ttymouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1112 set mousetime& |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1113 call test_override('no_query_mouse', 0) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1114 endfunc |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1115 |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1116 " Middle click in command line pastes at position of cursor. |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1117 func Test_term_mouse_middle_click_in_cmdline_to_paste() |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1118 CheckFeature clipboard_working |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1119 let save_mouse = &mouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1120 let save_term = &term |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1121 let save_ttymouse = &ttymouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1122 call test_override('no_query_mouse', 1) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1123 set mouse=a term=xterm |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1124 let row = &lines |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1125 " Column values does not matter, paste is done at position of cursor. |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1126 let col = 1 |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1127 let @* = 'paste' |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1128 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
1129 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1130 let msg = 'ttymouse=' .. ttymouse_val |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1131 exe 'set ttymouse=' .. ttymouse_val |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1132 |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1133 call feedkeys(":\"->" |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1134 \ .. MouseMiddleReleaseCode(row, col) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1135 \ .. MouseMiddleClickCode(row, col) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1136 \ .. "<-" |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1137 \ .. MouseMiddleReleaseCode(row, col) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1138 \ .. MouseMiddleClickCode(row, col) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1139 \ .. "\<CR>", 'Lx!') |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1140 call assert_equal('"->paste<-paste', @:, msg) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1141 endfor |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1142 |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1143 let &mouse = save_mouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1144 let &term = save_term |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1145 let &ttymouse = save_ttymouse |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1146 let @* = '' |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1147 call test_override('no_query_mouse', 0) |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1148 endfunc |
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1149 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1150 " Test for making sure S-Middlemouse doesn't do anything |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1151 func Test_term_mouse_shift_middle_click() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1152 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1153 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1154 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1155 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1156 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1157 set mouse=a term=xterm ttymouse=xterm2 mousemodel= |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1158 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1159 call test_setmouse(1, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1160 exe "normal \<S-MiddleMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1161 call assert_equal([''], getline(1, '$')) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1162 call assert_equal(1, winnr()) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1163 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1164 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1165 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1166 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1167 set mousemodel& |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1168 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1169 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1170 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1171 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1172 " Test for using mouse in visual mode |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1173 func Test_term_mouse_visual_mode() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1174 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1175 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1176 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1177 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1178 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1179 set term=xterm ttymouse=xterm2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1180 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1181 " If visual mode is not present in 'mouse', then left click should not |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1182 " do anything in visal mode. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1183 call setline(1, ['one two three four']) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1184 set mouse=nci |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1185 call cursor(1, 5) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1186 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1187 call feedkeys("ve" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1188 \ .. MouseLeftClickCode(1, 15) .. MouseLeftReleaseCode(1, 15) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1189 \ .. 'y', 'Lx!') |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1190 call assert_equal(5, col('.')) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1191 call assert_equal('two', @") |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1192 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1193 " Pressing right click in visual mode should change the visual selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1194 " if 'mousemodel' doesn't contain popup. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1195 " Right click after the visual selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1196 set mousemodel= |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1197 set mouse=a |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1198 call test_setmouse(1, 13) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1199 exe "normal 5|ve\<RightMouse>y" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1200 call assert_equal('two three', @") |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1201 call assert_equal(5, col('.')) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1202 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1203 " Right click before the visual selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1204 call test_setmouse(1, 9) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1205 exe "normal 15|ve\<RightMouse>y" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1206 call assert_equal('three four', @") |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1207 call assert_equal(9, col('.')) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1208 |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1209 " Right click inside the selection closer to the start of the selection |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1210 call test_setmouse(1, 7) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1211 exe "normal 5|vee\<RightMouse>lly" |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1212 call assert_equal('three', @") |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1213 call assert_equal(9, col('.')) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1214 call assert_equal(9, col("'<")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1215 call assert_equal(13, col("'>")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1216 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1217 " Right click inside the selection closer to the end of the selection |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1218 call test_setmouse(1, 11) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1219 exe "normal 5|vee\<RightMouse>ly" |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1220 call assert_equal('two thre', @") |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1221 call assert_equal(5, col('.')) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1222 call assert_equal(5, col("'<")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1223 call assert_equal(12, col("'>")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1224 |
30986
360f286b5869
patch 9.0.0828: various typos
Bram Moolenaar <Bram@vim.org>
parents:
30980
diff
changeset
|
1225 " Multi-line selection. Right click inside the selection. |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1226 call setline(1, repeat(['aaaaaa'], 7)) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1227 call test_setmouse(3, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1228 exe "normal ggVG\<RightMouse>y" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1229 call assert_equal(3, line("'<")) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1230 call test_setmouse(5, 1) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1231 exe "normal ggVG\<RightMouse>y" |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1232 call assert_equal(5, line("'>")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1233 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1234 " Click right in the middle line of the selection |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1235 call test_setmouse(4, 3) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1236 exe "normal ggVG$\<RightMouse>y" |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1237 call assert_equal(4, line("'<")) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1238 call test_setmouse(4, 4) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1239 exe "normal ggVG$\<RightMouse>y" |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1240 call assert_equal(4, line("'>")) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1241 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1242 set mousemodel& |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1243 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1244 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1245 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1246 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1247 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1248 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1249 |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1250 " Test for displaying the popup menu using the right mouse click |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1251 func Test_term_mouse_popup_menu() |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1252 CheckFeature menu |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1253 new |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1254 call setline(1, 'popup menu test') |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1255 let save_mouse = &mouse |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1256 let save_term = &term |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1257 let save_ttymouse = &ttymouse |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1258 let save_mousemodel = &mousemodel |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1259 call test_override('no_query_mouse', 1) |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1260 set mouse=a term=xterm mousemodel=popup |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1261 |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1262 menu PopUp.foo :let g:menustr = 'foo'<CR> |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1263 menu PopUp.bar :let g:menustr = 'bar'<CR> |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1264 menu PopUp.baz :let g:menustr = 'baz'<CR> |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1265 |
19738
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19657
diff
changeset
|
1266 for ttymouse_val in g:Ttymouse_values |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1267 let msg = 'ttymouse=' .. ttymouse_val |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1268 exe 'set ttymouse=' .. ttymouse_val |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1269 let g:menustr = '' |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1270 call feedkeys(MouseRightClickCode(1, 4) |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1271 \ .. MouseRightReleaseCode(1, 4) .. "\<Down>\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1272 call assert_equal('bar', g:menustr, msg) |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1273 endfor |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1274 |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1275 unmenu PopUp |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1276 let &mouse = save_mouse |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1277 let &term = save_term |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1278 let &ttymouse = save_ttymouse |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1279 let &mousemodel = save_mousemodel |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1280 call test_override('no_query_mouse', 0) |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1281 close! |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1282 endfunc |
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
1283 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1284 " Test for 'mousemodel' set to popup_setpos to move the cursor where the popup |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1285 " menu is displayed. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1286 func Test_term_mouse_popup_menu_setpos() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1287 CheckFeature menu |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1288 5new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1289 call setline(1, ['the dish ran away with the spoon', |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1290 \ 'the cow jumped over the moon' ]) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1291 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1292 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1293 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1294 let save_mousemodel = &mousemodel |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1295 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1296 set mouse=a term=xterm mousemodel=popup_setpos |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1297 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1298 nmenu PopUp.foo :let g:menustr = 'foo'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1299 nmenu PopUp.bar :let g:menustr = 'bar'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1300 nmenu PopUp.baz :let g:menustr = 'baz'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1301 vmenu PopUp.foo y:<C-U>let g:menustr = 'foo'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1302 vmenu PopUp.bar y:<C-U>let g:menustr = 'bar'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1303 vmenu PopUp.baz y:<C-U>let g:menustr = 'baz'<CR> |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1304 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1305 for ttymouse_val in g:Ttymouse_values |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1306 let msg = 'ttymouse=' .. ttymouse_val |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1307 exe 'set ttymouse=' .. ttymouse_val |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1308 let g:menustr = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1309 call cursor(1, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1310 call feedkeys(MouseRightClickCode(1, 5) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1311 \ .. MouseRightReleaseCode(1, 5) .. "\<Down>\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1312 call assert_equal('bar', g:menustr, msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1313 call assert_equal([1, 5], [line('.'), col('.')], msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1314 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1315 " Test for right click in visual mode inside the selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1316 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1317 call cursor(1, 10) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1318 call feedkeys('vee' .. MouseRightClickCode(1, 12) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1319 \ .. MouseRightReleaseCode(1, 12) .. "\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1320 call assert_equal([1, 10], [line('.'), col('.')], msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1321 call assert_equal('ran away', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1322 |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1323 " Test for right click in visual mode right before the selection |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1324 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1325 call cursor(1, 10) |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1326 call feedkeys('vee' .. MouseRightClickCode(1, 9) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1327 \ .. MouseRightReleaseCode(1, 9) .. "\<Down>\<CR>", "x") |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1328 call assert_equal([1, 9], [line('.'), col('.')], msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1329 call assert_equal('', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1330 |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1331 " Test for right click in visual mode right after the selection |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1332 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1333 call cursor(1, 10) |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1334 call feedkeys('vee' .. MouseRightClickCode(1, 18) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1335 \ .. MouseRightReleaseCode(1, 18) .. "\<Down>\<CR>", "x") |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1336 call assert_equal([1, 18], [line('.'), col('.')], msg) |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1337 call assert_equal('', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1338 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1339 " Test for right click in block-wise visual mode inside the selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1340 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1341 call cursor(1, 16) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1342 call feedkeys("\<C-V>j3l" .. MouseRightClickCode(2, 17) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1343 \ .. MouseRightReleaseCode(2, 17) .. "\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1344 call assert_equal([1, 16], [line('.'), col('.')], msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1345 call assert_equal("\<C-V>4", getregtype('"'), msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1346 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1347 " Test for right click in block-wise visual mode outside the selection |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1348 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1349 call cursor(1, 16) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1350 call feedkeys("\<C-V>j3l" .. MouseRightClickCode(2, 2) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1351 \ .. MouseRightReleaseCode(2, 2) .. "\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1352 call assert_equal([2, 2], [line('.'), col('.')], msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1353 call assert_equal('v', getregtype('"'), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1354 call assert_equal('', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1355 |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1356 " Test for right click in line-wise visual mode inside the selection |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1357 let @" = '' |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1358 call cursor(1, 16) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1359 call feedkeys("V" .. MouseRightClickCode(1, 10) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1360 \ .. MouseRightReleaseCode(1, 10) .. "\<Down>\<CR>", "x") |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1361 call assert_equal([1, 1], [line('.'), col('.')], msg) " After yanking, the cursor goes to 1,1 |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1362 call assert_equal("V", getregtype('"'), msg) |
30926
372b12480082
patch 9.0.0797: order of assert function arguments is reverted
Bram Moolenaar <Bram@vim.org>
parents:
30827
diff
changeset
|
1363 call assert_equal(1, len(getreg('"', 1, v:true)), msg) |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1364 |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1365 " Test for right click in multi-line line-wise visual mode inside the selection |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1366 let @" = '' |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1367 call cursor(1, 16) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1368 call feedkeys("Vj" .. MouseRightClickCode(2, 20) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1369 \ .. MouseRightReleaseCode(2, 20) .. "\<Down>\<CR>", "x") |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1370 call assert_equal([1, 1], [line('.'), col('.')], msg) " After yanking, the cursor goes to 1,1 |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1371 call assert_equal("V", getregtype('"'), msg) |
30926
372b12480082
patch 9.0.0797: order of assert function arguments is reverted
Bram Moolenaar <Bram@vim.org>
parents:
30827
diff
changeset
|
1372 call assert_equal(2, len(getreg('"', 1, v:true)), msg) |
30809
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1373 |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1374 " Test for right click in line-wise visual mode outside the selection |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1375 let @" = '' |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1376 call cursor(1, 16) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1377 call feedkeys("V" .. MouseRightClickCode(2, 10) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1378 \ .. MouseRightReleaseCode(2, 10) .. "\<Down>\<CR>", "x") |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1379 call assert_equal([2, 10], [line('.'), col('.')], msg) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1380 call assert_equal("", @", msg) |
ffdb7a6785af
patch 9.0.0739: mouse column not correctly used for popup_setpos
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1381 |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1382 " Try clicking on the status line |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1383 let @" = '' |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1384 call cursor(1, 10) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1385 call feedkeys('vee' .. MouseRightClickCode(6, 2) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1386 \ .. MouseRightReleaseCode(6, 2) .. "\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1387 call assert_equal([1, 10], [line('.'), col('.')], msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1388 call assert_equal('ran away', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1389 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1390 " Try clicking outside the window |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1391 let @" = '' |
30926
372b12480082
patch 9.0.0797: order of assert function arguments is reverted
Bram Moolenaar <Bram@vim.org>
parents:
30827
diff
changeset
|
1392 call cursor(2, 2) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1393 call feedkeys('vee' .. MouseRightClickCode(7, 2) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1394 \ .. MouseRightReleaseCode(7, 2) .. "\<Down>\<CR>", "x") |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1395 call assert_equal(2, winnr(), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1396 call assert_equal('', @", msg) |
21325
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1397 wincmd w |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1398 endfor |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1399 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1400 unmenu PopUp |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1401 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1402 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1403 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1404 let &mousemodel = save_mousemodel |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1405 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1406 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1407 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1408 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1409 " Test for searching for the word under the cursor using Shift-Right or |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1410 " Shift-Left click. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1411 func Test_term_mouse_search() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1412 new |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1413 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1414 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1415 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1416 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1417 set mouse=a term=xterm ttymouse=xterm2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1418 set mousemodel= |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1419 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1420 " In normal mode, Shift-Left or Shift-Right click should search for the word |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1421 " under the cursor. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1422 call setline(1, ['one two three four', 'four three two one']) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1423 call test_setmouse(1, 4) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1424 exe "normal \<S-LeftMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1425 call assert_equal([2, 12], [line('.'), col('.')]) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1426 call test_setmouse(2, 16) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1427 exe "normal \<S-RightMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1428 call assert_equal([1, 1], [line('.'), col('.')]) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1429 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1430 " In visual mode, Shift-Left or Shift-Right click should search for the word |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1431 " under the cursor and extend the selection. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1432 call test_setmouse(1, 4) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1433 exe "normal 4|ve\<S-LeftMouse>y" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1434 call assert_equal([2, 12], [line("'>"), col("'>")]) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1435 call test_setmouse(2, 16) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1436 exe "normal 2G16|ve\<S-RightMouse>y" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1437 call assert_equal([1, 1], [line("'<"), col("'<")]) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1438 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1439 set mousemodel& |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1440 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1441 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1442 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1443 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1444 close! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1445 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1446 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1447 " Test for selecting an entry in the quickfix/location list window using the |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1448 " mouse. |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1449 func Test_term_mouse_quickfix_window() |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1450 let save_mouse = &mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1451 let save_term = &term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1452 let save_ttymouse = &ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1453 call test_override('no_query_mouse', 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1454 set mouse=a term=xterm ttymouse=xterm2 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1455 set mousemodel= |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1456 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1457 cgetexpr "Xfile1:1:L1" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1458 copen 5 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1459 call test_setmouse(&lines - 7, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1460 exe "normal \<2-LeftMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1461 call assert_equal('Xfile1', @%) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1462 %bw! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1463 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1464 lgetexpr "Xfile2:1:L1" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1465 lopen 5 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1466 call test_setmouse(&lines - 7, 1) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1467 exe "normal \<2-LeftMouse>" |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1468 call assert_equal('Xfile2', @%) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1469 %bw! |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1470 |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1471 set mousemodel& |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1472 let &mouse = save_mouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1473 let &term = save_term |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1474 let &ttymouse = save_ttymouse |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1475 call test_override('no_query_mouse', 0) |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1476 endfunc |
f68b121daa47
patch 8.2.1213: mouse codes not tested sufficiently
Bram Moolenaar <Bram@vim.org>
parents:
21114
diff
changeset
|
1477 |
21369
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1478 " Test for the 'h' flag in the 'mouse' option. Using mouse in the help window. |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1479 func Test_term_mouse_help_window() |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1480 let save_mouse = &mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1481 let save_term = &term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1482 let save_ttymouse = &ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1483 call test_override('no_query_mouse', 1) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1484 set mouse=h term=xterm mousetime=200 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1485 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1486 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1487 let msg = 'ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1488 exe 'set ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1489 help |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1490 let @" = '' |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1491 call MouseLeftClick(2, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1492 call MouseLeftRelease(2, 5) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1493 call MouseLeftClick(1, 1) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1494 call MouseLeftDrag(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1495 call MouseLeftRelease(1, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1496 norm! y |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1497 call assert_equal('*help.txt*', @", msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1498 helpclose |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1499 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1500 " Click somewhere else to make sure the left click above is not combined |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1501 " with the next left click and treated as a double click |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1502 call MouseRightClick(5, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1503 call MouseRightRelease(5, 10) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1504 endfor |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1505 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1506 let &mouse = save_mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1507 let &term = save_term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1508 let &ttymouse = save_ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1509 set mousetime& |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1510 call test_override('no_query_mouse', 0) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1511 %bw! |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1512 endfunc |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1513 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1514 " Test for the translation of various mouse terminal codes |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1515 func Test_mouse_termcodes() |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1516 let save_mouse = &mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1517 let save_term = &term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1518 let save_ttymouse = &ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1519 call test_override('no_query_mouse', 1) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1520 set mouse=a term=xterm mousetime=200 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1521 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1522 new |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1523 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1524 let msg = 'ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1525 exe 'set ttymouse=' .. ttymouse_val |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1526 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1527 let mouse_codes = [ |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1528 \ ["\<LeftMouse>", "<LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1529 \ ["\<MiddleMouse>", "<MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1530 \ ["\<RightMouse>", "<RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1531 \ ["\<S-LeftMouse>", "<S-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1532 \ ["\<S-MiddleMouse>", "<S-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1533 \ ["\<S-RightMouse>", "<S-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1534 \ ["\<C-LeftMouse>", "<C-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1535 \ ["\<C-MiddleMouse>", "<C-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1536 \ ["\<C-RightMouse>", "<C-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1537 \ ["\<M-LeftMouse>", "<M-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1538 \ ["\<M-MiddleMouse>", "<M-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1539 \ ["\<M-RightMouse>", "<M-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1540 \ ["\<2-LeftMouse>", "<2-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1541 \ ["\<2-MiddleMouse>", "<2-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1542 \ ["\<2-RightMouse>", "<2-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1543 \ ["\<3-LeftMouse>", "<3-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1544 \ ["\<3-MiddleMouse>", "<3-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1545 \ ["\<3-RightMouse>", "<3-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1546 \ ["\<4-LeftMouse>", "<4-LeftMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1547 \ ["\<4-MiddleMouse>", "<4-MiddleMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1548 \ ["\<4-RightMouse>", "<4-RightMouse>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1549 \ ["\<LeftDrag>", "<LeftDrag>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1550 \ ["\<MiddleDrag>", "<MiddleDrag>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1551 \ ["\<RightDrag>", "<RightDrag>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1552 \ ["\<LeftRelease>", "<LeftRelease>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1553 \ ["\<MiddleRelease>", "<MiddleRelease>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1554 \ ["\<RightRelease>", "<RightRelease>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1555 \ ["\<ScrollWheelUp>", "<ScrollWheelUp>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1556 \ ["\<S-ScrollWheelUp>", "<S-ScrollWheelUp>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1557 \ ["\<C-ScrollWheelUp>", "<C-ScrollWheelUp>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1558 \ ["\<ScrollWheelDown>", "<ScrollWheelDown>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1559 \ ["\<S-ScrollWheelDown>", "<S-ScrollWheelDown>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1560 \ ["\<C-ScrollWheelDown>", "<C-ScrollWheelDown>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1561 \ ["\<ScrollWheelLeft>", "<ScrollWheelLeft>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1562 \ ["\<S-ScrollWheelLeft>", "<S-ScrollWheelLeft>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1563 \ ["\<C-ScrollWheelLeft>", "<C-ScrollWheelLeft>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1564 \ ["\<ScrollWheelRight>", "<ScrollWheelRight>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1565 \ ["\<S-ScrollWheelRight>", "<S-ScrollWheelRight>"], |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1566 \ ["\<C-ScrollWheelRight>", "<C-ScrollWheelRight>"] |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1567 \ ] |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1568 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1569 for [code, outstr] in mouse_codes |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1570 exe "normal ggC\<C-K>" . code |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1571 call assert_equal(outstr, getline(1), msg) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1572 endfor |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1573 endfor |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1574 |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1575 let &mouse = save_mouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1576 let &term = save_term |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1577 let &ttymouse = save_ttymouse |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1578 set mousetime& |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1579 call test_override('no_query_mouse', 0) |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1580 %bw! |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1581 endfunc |
e00467b9f5de
patch 8.2.1235: Not all mouse codes covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
21325
diff
changeset
|
1582 |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1583 " This only checks if the sequence is recognized. |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1584 func Test_term_rgb_response() |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1585 set t_RF=x |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1586 set t_RB=y |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1587 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1588 " response to t_RF, 4 digits |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1589 let red = 0x12 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1590 let green = 0x34 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1591 let blue = 0x56 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1592 let seq = printf("\<Esc>]10;rgb:%02x00/%02x00/%02x00\x07", red, green, blue) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1593 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1594 call assert_equal(seq, v:termrfgresp) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1595 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1596 " response to t_RF, 2 digits |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1597 let red = 0x78 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1598 let green = 0x9a |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1599 let blue = 0xbc |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1600 let seq = printf("\<Esc>]10;rgb:%02x/%02x/%02x\x07", red, green, blue) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1601 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1602 call assert_equal(seq, v:termrfgresp) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1603 |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1604 " response to t_RB, 4 digits, dark |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1605 set background=light |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17914
diff
changeset
|
1606 eval 'background'->test_option_not_set() |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1607 let red = 0x29 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1608 let green = 0x4a |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1609 let blue = 0x6b |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1610 let seq = printf("\<Esc>]11;rgb:%02x00/%02x00/%02x00\x07", red, green, blue) |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1611 call feedkeys(seq, 'Lx!') |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1612 call assert_equal(seq, v:termrbgresp) |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1613 call assert_equal('dark', &background) |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1614 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1615 " response to t_RB, 4 digits, light |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1616 set background=dark |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1617 call test_option_not_set('background') |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1618 let red = 0x81 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1619 let green = 0x63 |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1620 let blue = 0x65 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1621 let seq = printf("\<Esc>]11;rgb:%02x00/%02x00/%02x00\x07", red, green, blue) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1622 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1623 call assert_equal(seq, v:termrbgresp) |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1624 call assert_equal('light', &background) |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1625 |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1626 " response to t_RB, 2 digits, dark |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1627 set background=light |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1628 call test_option_not_set('background') |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1629 let red = 0x47 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1630 let green = 0x59 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1631 let blue = 0x5b |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1632 let seq = printf("\<Esc>]11;rgb:%02x/%02x/%02x\x07", red, green, blue) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1633 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1634 call assert_equal(seq, v:termrbgresp) |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1635 call assert_equal('dark', &background) |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1636 |
16940
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1637 " response to t_RB, 2 digits, light |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1638 set background=dark |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1639 call test_option_not_set('background') |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1640 let red = 0x83 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1641 let green = 0xa4 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1642 let blue = 0xc2 |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1643 let seq = printf("\<Esc>]11;rgb:%02x/%02x/%02x\x07", red, green, blue) |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1644 call feedkeys(seq, 'Lx!') |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1645 call assert_equal(seq, v:termrbgresp) |
1c264ca8f2e8
patch 8.1.1471: 'background' not correctly set for 2-digit rgb termresponse
Bram Moolenaar <Bram@vim.org>
parents:
16936
diff
changeset
|
1646 call assert_equal('light', &background) |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
1647 |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1648 set t_RF= t_RB= |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1649 endfunc |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1650 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1651 " This only checks if the sequence is recognized. |
18285
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1652 " This must be after other tests, because it has side effects to xterm |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1653 " properties. |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1654 func Test_xx01_term_style_response() |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1655 " Termresponse is only parsed when t_RV is not empty. |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1656 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1657 call test_override('term_props', 1) |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1658 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1659 " send the termresponse to trigger requesting the XT codes |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1660 let seq = "\<Esc>[>41;337;0c" |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1661 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1662 call assert_equal(seq, v:termresponse) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1663 |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1664 let seq = "\<Esc>P1$r2 q\<Esc>\\" |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1665 call feedkeys(seq, 'Lx!') |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1666 call assert_equal(seq, v:termstyleresp) |
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1667 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1668 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1669 \ cursor_style: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1670 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1671 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1672 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1673 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1674 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1675 |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1676 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1677 call test_override('term_props', 0) |
16936
73e6ed2f69a2
patch 8.1.1469: no test for checking the cursor style response
Bram Moolenaar <Bram@vim.org>
parents:
16493
diff
changeset
|
1678 endfunc |
16942
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
1679 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1680 " This checks the iTerm2 version response. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1681 " This must be after other tests, because it has side effects to xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1682 " properties. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1683 func Test_xx02_iTerm2_response() |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1684 " Termresponse is only parsed when t_RV is not empty. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1685 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1686 call test_override('term_props', 1) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1687 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1688 " Old versions of iTerm2 used a different style term response. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1689 set ttymouse=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1690 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1691 let seq = "\<Esc>[>0;95;c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1692 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1693 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1694 call assert_equal('xterm', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1695 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1696 set ttymouse=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1697 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1698 let seq = "\<Esc>[>0;95;0c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1699 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1700 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1701 call assert_equal('sgr', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1702 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1703 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1704 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1705 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1706 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1707 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1708 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1709 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1710 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1711 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1712 call test_override('term_props', 0) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1713 endfunc |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1714 |
29869
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1715 func Run_libvterm_konsole_response(code) |
18285
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1716 set ttymouse=xterm |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1717 call test_option_not_set('ttymouse') |
29869
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1718 let seq = "\<Esc>[>0;" .. a:code .. ";0c" |
18285
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1719 call feedkeys(seq, 'Lx!') |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1720 call assert_equal(seq, v:termresponse) |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1721 call assert_equal('sgr', &ttymouse) |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1722 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1723 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1724 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1725 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1726 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1727 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1728 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1729 \ }, terminalprops()) |
29869
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1730 endfunc |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1731 |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1732 " This checks the libvterm version response. |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1733 " This must be after other tests, because it has side effects to xterm |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1734 " properties. |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1735 func Test_xx03_libvterm_konsole_response() |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1736 " Termresponse is only parsed when t_RV is not empty. |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1737 set t_RV=x |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1738 call test_override('term_props', 1) |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1739 |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1740 " libvterm |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1741 call Run_libvterm_konsole_response(100) |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1742 " Konsole |
0eab537e9ccb
patch 9.0.0273: Konsole termresponse not recognized
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
1743 call Run_libvterm_konsole_response(115) |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1744 |
18285
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1745 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1746 call test_override('term_props', 0) |
18285
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1747 endfunc |
db8cd5e56586
patch 8.1.2137: parsing the termresponse is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18247
diff
changeset
|
1748 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1749 " This checks the Mac Terminal.app version response. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1750 " This must be after other tests, because it has side effects to xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1751 " properties. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1752 func Test_xx04_Mac_Terminal_response() |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1753 " Termresponse is only parsed when t_RV is not empty. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1754 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1755 call test_override('term_props', 1) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1756 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1757 set ttymouse=xterm |
20850
bf7453768034
patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents:
20836
diff
changeset
|
1758 " t_8u is not reset |
bf7453768034
patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents:
20836
diff
changeset
|
1759 let &t_8u = "\<Esc>[58;2;%lu;%lu;%lum" |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1760 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1761 let seq = "\<Esc>[>1;95;0c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1762 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1763 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1764 call assert_equal('sgr', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1765 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1766 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1767 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1768 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1769 \ underline_rgb: 'y', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1770 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1771 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1772 \ }, terminalprops()) |
20850
bf7453768034
patch 8.2.0977: t_8u is made empty for the wrong terminals
Bram Moolenaar <Bram@vim.org>
parents:
20836
diff
changeset
|
1773 call assert_equal("\<Esc>[58;2;%lu;%lu;%lum", &t_8u) |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1774 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1775 " Reset is_not_xterm and is_mac_terminal. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1776 set t_RV= |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1777 set term=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1778 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1779 call test_override('term_props', 0) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1780 endfunc |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1781 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1782 " This checks the mintty version response. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1783 " This must be after other tests, because it has side effects to xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1784 " properties. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1785 func Test_xx05_mintty_response() |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1786 " Termresponse is only parsed when t_RV is not empty. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1787 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1788 call test_override('term_props', 1) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1789 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1790 set ttymouse=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1791 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1792 let seq = "\<Esc>[>77;20905;0c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1793 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1794 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1795 call assert_equal('sgr', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1796 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1797 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1798 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1799 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1800 \ underline_rgb: 'y', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1801 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1802 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1803 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1804 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1805 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1806 call test_override('term_props', 0) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1807 endfunc |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1808 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1809 " This checks the screen version response. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1810 " This must be after other tests, because it has side effects to xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1811 " properties. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1812 func Test_xx06_screen_response() |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1813 " Termresponse is only parsed when t_RV is not empty. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1814 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1815 call test_override('term_props', 1) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1816 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1817 " Old versions of screen don't support SGR mouse mode. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1818 set ttymouse=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1819 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1820 let seq = "\<Esc>[>83;40500;0c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1821 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1822 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1823 call assert_equal('xterm', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1824 |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1825 " screen supports SGR mouse mode starting in version 4.7. |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1826 set ttymouse=xterm |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1827 call test_option_not_set('ttymouse') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1828 let seq = "\<Esc>[>83;40700;0c" |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1829 call feedkeys(seq, 'Lx!') |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1830 call assert_equal(seq, v:termresponse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1831 call assert_equal('sgr', &ttymouse) |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1832 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1833 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1834 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1835 \ cursor_blink_mode: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1836 \ underline_rgb: 'y', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1837 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1838 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1839 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1840 |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1841 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1842 call test_override('term_props', 0) |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1843 endfunc |
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1844 |
28552
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1845 func Do_check_t_8u_set_reset(set_by_user) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1846 set ttymouse=xterm |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1847 call test_option_not_set('ttymouse') |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1848 let default_value = "\<Esc>[58;2;%lu;%lu;%lum" |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1849 let &t_8u = default_value |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1850 if !a:set_by_user |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1851 call test_option_not_set('t_8u') |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1852 endif |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1853 let seq = "\<Esc>[>0;279;0c" |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1854 call feedkeys(seq, 'Lx!') |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1855 call assert_equal(seq, v:termresponse) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1856 call assert_equal('sgr', &ttymouse) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1857 |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1858 call assert_equal(#{ |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1859 \ cursor_style: 'u', |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1860 \ cursor_blink_mode: 'u', |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1861 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1862 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1863 \ kitty: 'u', |
28552
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1864 \ }, terminalprops()) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1865 call assert_equal(a:set_by_user ? default_value : '', &t_8u) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1866 endfunc |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1867 |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1868 " This checks the xterm version response. |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1869 " This must be after other tests, because it has side effects to xterm |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1870 " properties. |
18360
e460e6878406
patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes
Bram Moolenaar <Bram@vim.org>
parents:
18350
diff
changeset
|
1871 func Test_xx07_xterm_response() |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1872 " Termresponse is only parsed when t_RV is not empty. |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1873 set t_RV=x |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1874 call test_override('term_props', 1) |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1875 |
18350
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1876 " Do Terminal.app first to check that is_mac_terminal is reset. |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1877 set ttymouse=xterm |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1878 call test_option_not_set('ttymouse') |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1879 let seq = "\<Esc>[>1;95;0c" |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1880 call feedkeys(seq, 'Lx!') |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1881 call assert_equal(seq, v:termresponse) |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1882 call assert_equal('sgr', &ttymouse) |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1883 |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1884 " xterm < 95: "xterm" (actually unmodified) |
18350
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1885 set t_RV= |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1886 set term=xterm |
b1796f1b28fa
patch 8.1.2169: terminal flags are never reset
Bram Moolenaar <Bram@vim.org>
parents:
18311
diff
changeset
|
1887 set t_RV=x |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1888 set ttymouse=xterm |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1889 call test_option_not_set('ttymouse') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1890 let seq = "\<Esc>[>0;94;0c" |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1891 call feedkeys(seq, 'Lx!') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1892 call assert_equal(seq, v:termresponse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1893 call assert_equal('xterm', &ttymouse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1894 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1895 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1896 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1897 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1898 \ underline_rgb: 'y', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1899 \ mouse: 'u', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1900 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1901 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1902 |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1903 " xterm >= 95 < 277 "xterm2" |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1904 set ttymouse=xterm |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1905 call test_option_not_set('ttymouse') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1906 let seq = "\<Esc>[>0;267;0c" |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1907 call feedkeys(seq, 'Lx!') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1908 call assert_equal(seq, v:termresponse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1909 call assert_equal('xterm2', &ttymouse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1910 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1911 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1912 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1913 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1914 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1915 \ mouse: '2', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1916 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1917 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1918 |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1919 " xterm >= 277: "sgr" |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1920 set ttymouse=xterm |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1921 call test_option_not_set('ttymouse') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1922 let seq = "\<Esc>[>0;277;0c" |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1923 call feedkeys(seq, 'Lx!') |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1924 call assert_equal(seq, v:termresponse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1925 call assert_equal('sgr', &ttymouse) |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1926 |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1927 call assert_equal(#{ |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1928 \ cursor_style: 'n', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1929 \ cursor_blink_mode: 'u', |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1930 \ underline_rgb: 'u', |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1931 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1932 \ kitty: 'u', |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1933 \ }, terminalprops()) |
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1934 |
28552
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1935 " xterm >= 279: "sgr" and cursor_style not reset; also check t_8u reset, |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1936 " except when it was set by the user |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1937 call Do_check_t_8u_set_reset(0) |
90d57cd76564
patch 8.2.4800: missing test update for adjusted t_8u behavior
Bram Moolenaar <Bram@vim.org>
parents:
28127
diff
changeset
|
1938 call Do_check_t_8u_set_reset(1) |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1939 |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1940 set t_RV= |
20836
2616c5a337e0
patch 8.2.0970: terminal properties are not available in Vim script
Bram Moolenaar <Bram@vim.org>
parents:
20727
diff
changeset
|
1941 call test_override('term_props', 0) |
18311
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1942 endfunc |
60fce48438e2
patch 8.1.2150: no test for 'ttymouse' set from xterm version response
Bram Moolenaar <Bram@vim.org>
parents:
18307
diff
changeset
|
1943 |
30958
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1944 func Test_xx08_kitty_response() |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1945 " Termresponse is only parsed when t_RV is not empty. |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1946 set t_RV=x |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1947 call test_override('term_props', 1) |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1948 |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1949 set ttymouse=xterm |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1950 call test_option_not_set('ttymouse') |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1951 let seq = "\<Esc>[>1;4001;12c" |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1952 call feedkeys(seq, 'Lx!') |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1953 call assert_equal(seq, v:termresponse) |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1954 call assert_equal('sgr', &ttymouse) |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1955 |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1956 call assert_equal(#{ |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1957 \ cursor_style: 'u', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1958 \ cursor_blink_mode: 'u', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1959 \ underline_rgb: 'y', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1960 \ mouse: 's', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1961 \ kitty: 'y', |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1962 \ }, terminalprops()) |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1963 |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1964 set t_RV= |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1965 call test_override('term_props', 0) |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1966 endfunc |
122f883d7237
patch 9.0.0813: Kitty terminal is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
30926
diff
changeset
|
1967 |
23774
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1968 func Test_focus_events() |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1969 let save_term = &term |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1970 let save_ttymouse = &ttymouse |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1971 set term=xterm ttymouse=xterm2 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1972 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1973 au FocusGained * let g:focus_gained += 1 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1974 au FocusLost * let g:focus_lost += 1 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1975 let g:focus_gained = 0 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1976 let g:focus_lost = 0 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1977 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1978 call feedkeys("\<Esc>[O", "Lx!") |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1979 call assert_equal(1, g:focus_lost) |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1980 call feedkeys("\<Esc>[I", "Lx!") |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1981 call assert_equal(1, g:focus_gained) |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1982 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1983 " still works when 'ttymouse' is empty |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1984 set ttymouse= |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1985 call feedkeys("\<Esc>[O", "Lx!") |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1986 call assert_equal(2, g:focus_lost) |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1987 call feedkeys("\<Esc>[I", "Lx!") |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1988 call assert_equal(2, g:focus_gained) |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1989 |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1990 au! FocusGained |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1991 au! FocusLost |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1992 let &term = save_term |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1993 let &ttymouse = save_ttymouse |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1994 endfunc |
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1995 |
16942
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
1996 func Test_get_termcode() |
18247
eda5b2cb1dc4
patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents:
18223
diff
changeset
|
1997 try |
eda5b2cb1dc4
patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents:
18223
diff
changeset
|
1998 let k1 = &t_k1 |
eda5b2cb1dc4
patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents:
18223
diff
changeset
|
1999 catch /E113/ |
eda5b2cb1dc4
patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents:
18223
diff
changeset
|
2000 throw 'Skipped: Unable to query termcodes' |
eda5b2cb1dc4
patch 8.1.2118: termcodes test fails when $TERM is "dumb"
Bram Moolenaar <Bram@vim.org>
parents:
18223
diff
changeset
|
2001 endtry |
16942
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
2002 set t_k1= |
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
2003 set t_k1& |
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
2004 call assert_equal(k1, &t_k1) |
16947
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2005 |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2006 " use external termcap first |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2007 set nottybuiltin |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2008 set t_k1= |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2009 set t_k1& |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2010 " when using external termcap may get something else, but it must not be |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2011 " empty, since we would fallback to the builtin one. |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2012 call assert_notequal('', &t_k1) |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2013 |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2014 if &term =~ 'xterm' |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2015 " use internal termcap first |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2016 let term_save = &term |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2017 let &term = 'builtin_' .. &term |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2018 set t_k1= |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2019 set t_k1& |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2020 call assert_equal(k1, &t_k1) |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2021 let &term = term_save |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2022 endif |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2023 |
b2179cf1a0a5
patch 8.1.1474: 'ttybuiltin' is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16942
diff
changeset
|
2024 set ttybuiltin |
16942
5f3e960ce76d
patch 8.1.1472: add_termcap_entry() is not tested
Bram Moolenaar <Bram@vim.org>
parents:
16940
diff
changeset
|
2025 endfunc |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2026 |
21624
1d75baa22d9a
patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message
Bram Moolenaar <Bram@vim.org>
parents:
21369
diff
changeset
|
2027 func Test_list_builtin_terminals() |
21626
ebceee9391cf
patch 8.2.1363: test trying to run terminal when it is not supported
Bram Moolenaar <Bram@vim.org>
parents:
21624
diff
changeset
|
2028 CheckRunVimInTerminal |
31129
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2029 |
23029
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2030 call RunVimInTerminal('', #{rows: 14}) |
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2031 call term_sendkeys('', ":set cmdheight=3\<CR>") |
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2032 call TermWait('', 100) |
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2033 call term_sendkeys('', ":set term=xxx\<CR>") |
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2034 call TermWait('', 100) |
31129
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2035 |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2036 " Check that the list ends in "builtin_dumb" and "builtin_debug". |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2037 let dumb_idx = 0 |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2038 for n in range(8, 12) |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2039 if term_getline('', n) =~ 'builtin_dumb' |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2040 let dumb_idx = n |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2041 break |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2042 endif |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2043 endfor |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2044 call assert_notequal(0, dumb_idx, 'builtin_dumb not found') |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2045 |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2046 call assert_match('builtin_dumb', term_getline('', dumb_idx)) |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2047 call assert_match('builtin_debug', term_getline('', dumb_idx + 1)) |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2048 call assert_match('Not found in termcap', term_getline('', dumb_idx + 2)) |
9cc7b2cec8ad
patch 9.0.0899: the builtin terminals are in one long list
Bram Moolenaar <Bram@vim.org>
parents:
31123
diff
changeset
|
2049 |
23029
bc3a083b50cb
patch 8.2.2061: Vim9: E1030 error when using empty string for term_sendkeys()
Bram Moolenaar <Bram@vim.org>
parents:
22764
diff
changeset
|
2050 call StopVimInTerminal('') |
21624
1d75baa22d9a
patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message
Bram Moolenaar <Bram@vim.org>
parents:
21369
diff
changeset
|
2051 endfunc |
1d75baa22d9a
patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message
Bram Moolenaar <Bram@vim.org>
parents:
21369
diff
changeset
|
2052 |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2053 func GetEscCodeCSI27(key, modifier) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2054 let key = printf("%d", char2nr(a:key)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2055 let mod = printf("%d", a:modifier) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2056 return "\<Esc>[27;" .. mod .. ';' .. key .. '~' |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2057 endfunc |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2058 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2059 func GetEscCodeCSIu(key, modifier) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2060 let key = printf("%d", char2nr(a:key)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2061 let mod = printf("%d", a:modifier) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2062 return "\<Esc>[" .. key .. ';' .. mod .. 'u' |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2063 endfunc |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2064 |
30827
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2065 func GetEscCodeCSIuWithoutModifier(key) |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2066 let key = printf("%d", char2nr(a:key)) |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2067 return "\<Esc>[" .. key .. 'u' |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2068 endfunc |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2069 |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2070 " This checks the CSI sequences when in modifyOtherKeys mode. |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2071 " The mode doesn't need to be enabled, the codes are always detected. |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2072 func RunTest_modifyOtherKeys(func) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2073 new |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2074 set timeoutlen=10 |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2075 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
2076 " Shift-X is sent as 'X' with the shift modifier |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2077 call feedkeys('a' .. a:func('X', 2) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2078 call assert_equal('X', getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2079 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2080 " Ctrl-i is Tab |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2081 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2082 call feedkeys('a' .. a:func('i', 5) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2083 call assert_equal("\t", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2084 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2085 " Ctrl-I is also Tab |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2086 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2087 call feedkeys('a' .. a:func('I', 5) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2088 call assert_equal("\t", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2089 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2090 " Alt-x is ø |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2091 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2092 call feedkeys('a' .. a:func('x', 3) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2093 call assert_equal("ø", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2094 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2095 " Meta-x is also ø |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2096 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2097 call feedkeys('a' .. a:func('x', 9) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2098 call assert_equal("ø", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2099 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2100 " Alt-X is Ø |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2101 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2102 call feedkeys('a' .. a:func('X', 3) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2103 call assert_equal("Ø", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2104 |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2105 " Meta-X is ø |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2106 call setline(1, '') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2107 call feedkeys('a' .. a:func('X', 9) .. "\<Esc>", 'Lx!') |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2108 call assert_equal("Ø", getline(1)) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2109 |
18683
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2110 " Ctrl-6 is Ctrl-^ |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2111 split aaa |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2112 edit bbb |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2113 call feedkeys(a:func('6', 5), 'Lx!') |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2114 call assert_equal("aaa", bufname()) |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2115 bwipe aaa |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2116 bwipe bbb |
5ed740336224
patch 8.1.2333: with modifyOtherKeys CTRL-^ doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
18627
diff
changeset
|
2117 |
23076
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2118 " Ctrl-V X 33 is 3 |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2119 call setline(1, '') |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2120 call feedkeys("a\<C-V>" .. a:func('X', 2) .. "33\<Esc>", 'Lx!') |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2121 call assert_equal("3", getline(1)) |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2122 |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2123 " Ctrl-V U 12345 is Unicode 12345 |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2124 call setline(1, '') |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2125 call feedkeys("a\<C-V>" .. a:func('U', 2) .. "12345\<Esc>", 'Lx!') |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2126 call assert_equal("\U12345", getline(1)) |
5fbac68bda23
patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character
Bram Moolenaar <Bram@vim.org>
parents:
23029
diff
changeset
|
2127 |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2128 bwipe! |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2129 set timeoutlen& |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2130 endfunc |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2131 |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2132 func Test_modifyOtherKeys_basic() |
18289
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2133 call RunTest_modifyOtherKeys(function('GetEscCodeCSI27')) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2134 call RunTest_modifyOtherKeys(function('GetEscCodeCSIu')) |
16dd8ebc2339
patch 8.1.2139: the modifyOtherKeys codes are not tested
Bram Moolenaar <Bram@vim.org>
parents:
18285
diff
changeset
|
2135 endfunc |
18295
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2136 |
18709
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2137 func Test_modifyOtherKeys_no_mapping() |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2138 set timeoutlen=10 |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2139 |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2140 let @a = 'aaa' |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2141 call feedkeys(":let x = '" .. GetEscCodeCSI27('R', 5) .. GetEscCodeCSI27('R', 5) .. "a'\<CR>", 'Lx!') |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2142 call assert_equal("let x = 'aaa'", @:) |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2143 |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2144 new |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2145 call feedkeys("a" .. GetEscCodeCSI27('R', 5) .. GetEscCodeCSI27('R', 5) .. "a\<Esc>", 'Lx!') |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2146 call assert_equal("aaa", getline(1)) |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2147 bwipe! |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2148 |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2149 new |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2150 call feedkeys("axx\<CR>yy" .. GetEscCodeCSI27('G', 5) .. GetEscCodeCSI27('K', 5) .. "a\<Esc>", 'Lx!') |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2151 call assert_equal("axx", getline(1)) |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2152 call assert_equal("yy", getline(2)) |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2153 bwipe! |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2154 |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2155 set timeoutlen& |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2156 endfunc |
ac08c7ad9d37
patch 8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18683
diff
changeset
|
2157 |
30827
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2158 func Test_CSIu_keys_without_modifiers() |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2159 " Escape sent as `CSI 27 u` should act as normal escape and not undo |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2160 call setline(1, 'a') |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2161 call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\e"), 'Lx!') |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2162 call assert_equal('n', mode()) |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2163 call assert_equal('a', getline(1)) |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2164 |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2165 " Tab sent as `CSI 9 u` should work |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2166 call setline(1, '') |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2167 call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\t") .. "\<Esc>", 'Lx!') |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2168 call assert_equal("\t", getline(1)) |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2169 endfunc |
0c30130f8c94
patch 9.0.0748: Kitty may send key without modifiers with CSI u code
Bram Moolenaar <Bram@vim.org>
parents:
30809
diff
changeset
|
2170 |
26392
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2171 " Check that when DEC mouse codes are recognized a special key is handled. |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2172 func Test_ignore_dec_mouse() |
26422
4397cc04f2b1
patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents:
26392
diff
changeset
|
2173 silent !infocmp gnome >/dev/null 2>&1 |
4397cc04f2b1
patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents:
26392
diff
changeset
|
2174 if v:shell_error != 0 |
4397cc04f2b1
patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents:
26392
diff
changeset
|
2175 throw 'Skipped: gnome entry missing in the terminfo db' |
4397cc04f2b1
patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents:
26392
diff
changeset
|
2176 endif |
26392
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2177 |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2178 new |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2179 let save_mouse = &mouse |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2180 let save_term = &term |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2181 let save_ttymouse = &ttymouse |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2182 call test_override('no_query_mouse', 1) |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2183 set mouse=a term=gnome ttymouse= |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2184 |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2185 execute "set <xF1>=\<Esc>[1;*P" |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2186 nnoremap <S-F1> agot it<Esc> |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2187 call feedkeys("\<Esc>[1;2P", 'Lx!') |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2188 call assert_equal('got it', getline(1)) |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2189 |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2190 let &mouse = save_mouse |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2191 let &term = save_term |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2192 let &ttymouse = save_ttymouse |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2193 call test_override('no_query_mouse', 0) |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2194 bwipe! |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2195 endfunc |
201243ceaa18
patch 8.2.3727: in a gnome terminal keys are recognized as mouse events
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
2196 |
18295
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2197 func RunTest_mapping_shift(key, func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2198 call setline(1, '') |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2199 if a:key == '|' |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2200 exe 'inoremap \| xyz' |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2201 else |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2202 exe 'inoremap ' .. a:key .. ' xyz' |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2203 endif |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2204 call feedkeys('a' .. a:func(a:key, 2) .. "\<Esc>", 'Lx!') |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2205 call assert_equal("xyz", getline(1)) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2206 if a:key == '|' |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2207 exe 'iunmap \|' |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2208 else |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2209 exe 'iunmap ' .. a:key |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2210 endif |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2211 endfunc |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2212 |
20727
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2213 func Test_modifyOtherKeys_mapped() |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2214 set timeoutlen=10 |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2215 imap ' <C-W> |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2216 imap <C-W><C-A> c-a |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2217 call setline(1, '') |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2218 |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2219 " single quote is turned into single byte CTRL-W |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2220 " CTRL-A is added with a separate modifier, and needs to be simplified before |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2221 " the mapping can match. |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2222 call feedkeys("a'" .. GetEscCodeCSI27('A', 5) .. "\<Esc>", 'Lx!') |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2223 call assert_equal('c-a', getline(1)) |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2224 |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2225 iunmap ' |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2226 iunmap <C-W><C-A> |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2227 set timeoutlen& |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2228 endfunc |
5ffe112b1afd
patch 8.2.0916: mapping with partly modifyOtherKeys code does not work
Bram Moolenaar <Bram@vim.org>
parents:
20313
diff
changeset
|
2229 |
27958
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2230 func Test_modifyOtherKeys_ambiguous_mapping() |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2231 new |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2232 set timeoutlen=10 |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2233 map <C-J> a |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2234 map <C-J>x <Nop> |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2235 call setline(1, 'x') |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2236 |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2237 " CTRL-J b should have trigger the <C-J> mapping and then insert "b" |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2238 call feedkeys(GetEscCodeCSI27('J', 5) .. "b\<Esc>", 'Lx!') |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2239 call assert_equal('xb', getline(1)) |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2240 |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2241 unmap <C-J> |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2242 unmap <C-J>x |
28127
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2243 |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2244 " if a special character is following there should be a check for a termcode |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2245 nnoremap s aX<Esc> |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2246 nnoremap s<BS> aY<Esc> |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2247 set t_kb= |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2248 call setline(1, 'x') |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2249 call feedkeys("s\x08", 'Lx!') |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2250 call assert_equal('xY', getline(1)) |
b9e8f3674090
patch 8.2.4588: mapping with key after other matching mapping does not work
Bram Moolenaar <Bram@vim.org>
parents:
28053
diff
changeset
|
2251 |
27958
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2252 set timeoutlen& |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2253 bwipe! |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2254 endfunc |
ac7db4437368
patch 8.2.4504: when there is a partially matching map full map may not work
Bram Moolenaar <Bram@vim.org>
parents:
26422
diff
changeset
|
2255 |
22764
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2256 " Whether Shift-Tab sends "ESC [ Z" or "ESC [ 27 ; 2 ; 9 ~" is unpredictable, |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2257 " both should work. |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2258 func Test_modifyOtherKeys_shift_tab() |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2259 set timeoutlen=10 |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2260 |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2261 call setline(1, '') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2262 call feedkeys("a\<C-K>" .. GetEscCodeCSI27("\t", '2') .. "\<Esc>", 'Lx!') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2263 eval getline(1)->assert_equal('<S-Tab>') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2264 |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2265 call setline(1, '') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2266 call feedkeys("a\<C-K>\<Esc>[Z\<Esc>", 'Lx!') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2267 eval getline(1)->assert_equal('<S-Tab>') |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2268 |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2269 set timeoutlen& |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2270 bwipe! |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2271 endfunc |
d03221aa54f3
patch 8.2.1930: wrong input if removing shift results in special key code
Bram Moolenaar <Bram@vim.org>
parents:
22526
diff
changeset
|
2272 |
18295
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2273 func RunTest_mapping_works_with_shift(func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2274 new |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2275 set timeoutlen=10 |
18295
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2276 |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2277 call RunTest_mapping_shift('@', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2278 call RunTest_mapping_shift('A', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2279 call RunTest_mapping_shift('Z', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2280 call RunTest_mapping_shift('^', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2281 call RunTest_mapping_shift('_', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2282 call RunTest_mapping_shift('{', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2283 call RunTest_mapping_shift('|', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2284 call RunTest_mapping_shift('}', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2285 call RunTest_mapping_shift('~', a:func) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2286 |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2287 bwipe! |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2288 set timeoutlen& |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2289 endfunc |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2290 |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2291 func Test_mapping_works_with_shift_plain() |
18295
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2292 call RunTest_mapping_works_with_shift(function('GetEscCodeCSI27')) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2293 call RunTest_mapping_works_with_shift(function('GetEscCodeCSIu')) |
43e9523f6d84
patch 8.1.2142: some key mappings do not work with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18289
diff
changeset
|
2294 endfunc |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2295 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2296 func RunTest_mapping_mods(map, key, func, code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2297 call setline(1, '') |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2298 exe 'inoremap ' .. a:map .. ' xyz' |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2299 call feedkeys('a' .. a:func(a:key, a:code) .. "\<Esc>", 'Lx!') |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2300 call assert_equal("xyz", getline(1)) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2301 exe 'iunmap ' .. a:map |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2302 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2303 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2304 func RunTest_mapping_works_with_mods(func, mods, code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2305 new |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2306 set timeoutlen=10 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2307 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2308 if a:mods !~ 'S' |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2309 " Shift by itself has no effect |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2310 call RunTest_mapping_mods('<' .. a:mods .. '-@>', '@', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2311 endif |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2312 call RunTest_mapping_mods('<' .. a:mods .. '-A>', 'A', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2313 call RunTest_mapping_mods('<' .. a:mods .. '-Z>', 'Z', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2314 if a:mods !~ 'S' |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2315 " with Shift code is always upper case |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2316 call RunTest_mapping_mods('<' .. a:mods .. '-a>', 'a', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2317 call RunTest_mapping_mods('<' .. a:mods .. '-z>', 'z', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2318 endif |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2319 if a:mods != 'A' |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2320 " with Alt code is not in upper case |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2321 call RunTest_mapping_mods('<' .. a:mods .. '-a>', 'A', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2322 call RunTest_mapping_mods('<' .. a:mods .. '-z>', 'Z', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2323 endif |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2324 call RunTest_mapping_mods('<' .. a:mods .. '-á>', 'á', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2325 if a:mods !~ 'S' |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2326 " Shift by itself has no effect |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2327 call RunTest_mapping_mods('<' .. a:mods .. '-^>', '^', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2328 call RunTest_mapping_mods('<' .. a:mods .. '-_>', '_', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2329 call RunTest_mapping_mods('<' .. a:mods .. '-{>', '{', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2330 call RunTest_mapping_mods('<' .. a:mods .. '-\|>', '|', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2331 call RunTest_mapping_mods('<' .. a:mods .. '-}>', '}', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2332 call RunTest_mapping_mods('<' .. a:mods .. '-~>', '~', a:func, a:code) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2333 endif |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2334 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2335 bwipe! |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2336 set timeoutlen& |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2337 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2338 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2339 func Test_mapping_works_with_shift() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2340 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'S', 2) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2341 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'S', 2) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2342 endfunc |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
2343 |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2344 func Test_mapping_works_with_ctrl() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2345 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C', 5) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2346 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C', 5) |
22522
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2347 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2348 new |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2349 set timeoutlen=10 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2350 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2351 " CTRL-@ actually produces the code for CTRL-2, which is converted |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2352 call RunTest_mapping_mods('<C-@>', '2', function('GetEscCodeCSI27'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2353 call RunTest_mapping_mods('<C-@>', '2', function('GetEscCodeCSIu'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2354 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2355 " CTRL-^ actually produces the code for CTRL-6, which is converted |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2356 call RunTest_mapping_mods('<C-^>', '6', function('GetEscCodeCSI27'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2357 call RunTest_mapping_mods('<C-^>', '6', function('GetEscCodeCSIu'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2358 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2359 " CTRL-_ actually produces the code for CTRL--, which is converted |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2360 call RunTest_mapping_mods('<C-_>', '-', function('GetEscCodeCSI27'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2361 call RunTest_mapping_mods('<C-_>', '-', function('GetEscCodeCSIu'), 5) |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2362 |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2363 bwipe! |
6c7e4db139a3
patch 8.2.1809: mapping some keys with Ctrl does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
22407
diff
changeset
|
2364 set timeoutlen& |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2365 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2366 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2367 func Test_mapping_works_with_shift_ctrl() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2368 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S', 6) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2369 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S', 6) |
22526
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2370 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2371 new |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2372 set timeoutlen=10 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2373 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2374 " Ctrl-Shift-[ actually produces CTRL-Shift-{ which is mapped as <C-{> |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2375 call RunTest_mapping_mods('<C-{>', '{', function('GetEscCodeCSI27'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2376 call RunTest_mapping_mods('<C-{>', '{', function('GetEscCodeCSIu'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2377 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2378 " Ctrl-Shift-] actually produces CTRL-Shift-} which is mapped as <C-}> |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2379 call RunTest_mapping_mods('<C-{>', '{', function('GetEscCodeCSI27'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2380 call RunTest_mapping_mods('<C-{>', '{', function('GetEscCodeCSIu'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2381 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2382 " Ctrl-Shift-\ actually produces CTRL-Shift-| which is mapped as <C-|> |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2383 call RunTest_mapping_mods('<C-\|>', '|', function('GetEscCodeCSI27'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2384 call RunTest_mapping_mods('<C-\|>', '|', function('GetEscCodeCSIu'), 6) |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2385 |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2386 bwipe! |
6325ef9143bc
patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'
Bram Moolenaar <Bram@vim.org>
parents:
22522
diff
changeset
|
2387 set timeoutlen& |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2388 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2389 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2390 " Below we also test the "u" code with Alt, This works, but libvterm would not |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2391 " send the Alt key like this but by prefixing an Esc. |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
2392 |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2393 func Test_mapping_works_with_alt() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2394 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'A', 3) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2395 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'A', 3) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2396 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2397 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2398 func Test_mapping_works_with_shift_alt() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2399 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'S-A', 4) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2400 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'S-A', 4) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2401 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2402 |
22407
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2403 func Test_mapping_works_with_alt_and_shift() |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2404 new |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2405 set timeoutlen=10 |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2406 |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2407 " mapping <A-?> works even though the code is A-S-? |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2408 for c in ['!', '$', '+', ':', '?', '^', '~'] |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2409 call RunTest_mapping_mods('<A-' .. c .. '>', c, function('GetEscCodeCSI27'), 4) |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2410 call RunTest_mapping_mods('<A-' .. c .. '>', c, function('GetEscCodeCSIu'), 4) |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2411 endfor |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2412 |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2413 bwipe! |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2414 set timeoutlen& |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2415 endfunc |
c19acd92ee83
patch 8.2.1752: GTK GUI: cannot map alt-? with <A-?>
Bram Moolenaar <Bram@vim.org>
parents:
21897
diff
changeset
|
2416 |
18301
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2417 func Test_mapping_works_with_ctrl_alt() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2418 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-A', 7) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2419 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-A', 7) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2420 endfunc |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2421 |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2422 func Test_mapping_works_with_shift_ctrl_alt() |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2423 call RunTest_mapping_works_with_mods(function('GetEscCodeCSI27'), 'C-S-A', 8) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2424 call RunTest_mapping_works_with_mods(function('GetEscCodeCSIu'), 'C-S-A', 8) |
506bf60a30a0
patch 8.1.2145: cannot map <C-H> when modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents:
18295
diff
changeset
|
2425 endfunc |
18717
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2426 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2427 func Test_insert_literal() |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2428 set timeoutlen=10 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2429 new |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2430 " CTRL-V CTRL-X inserts a ^X |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2431 call feedkeys('a' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2432 call assert_equal("\<C-X>", getline(1)) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2433 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2434 call setline(1, '') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2435 call feedkeys('a' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2436 call assert_equal("\<C-X>", getline(1)) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2437 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
2438 " CTRL-SHIFT-V CTRL-X inserts escape sequence |
18717
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2439 call setline(1, '') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2440 call feedkeys('a' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('X', '5') .. "\<Esc>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2441 call assert_equal("\<Esc>[88;5u", getline(1)) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2442 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2443 call setline(1, '') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2444 call feedkeys('a' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('X', '5') .. "\<Esc>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2445 call assert_equal("\<Esc>[27;5;88~", getline(1)) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2446 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2447 bwipe! |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2448 set timeoutlen& |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2449 endfunc |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2450 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2451 func Test_cmdline_literal() |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2452 set timeoutlen=10 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2453 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2454 " CTRL-V CTRL-Y inserts a ^Y |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2455 call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2456 call assert_equal("\"\<C-Y>", @:) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2457 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2458 call feedkeys(':' .. GetEscCodeCSI27('V', '5') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2459 call assert_equal("\"\<C-Y>", @:) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2460 |
18918
5c256866b837
patch 8.2.0020: mouse clicks in the command line not tested
Bram Moolenaar <Bram@vim.org>
parents:
18717
diff
changeset
|
2461 " CTRL-SHIFT-V CTRL-Y inserts escape sequence |
18717
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2462 call feedkeys(':' .. GetEscCodeCSIu('V', '6') .. GetEscCodeCSIu('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2463 call assert_equal("\"\<Esc>[89;5u", @:) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2464 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2465 call setline(1, '') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2466 call feedkeys(':' .. GetEscCodeCSI27('V', '6') .. GetEscCodeCSI27('Y', '5') .. "\<C-B>\"\<CR>", 'Lx!') |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2467 call assert_equal("\"\<Esc>[27;5;89~", @:) |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2468 |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2469 set timeoutlen& |
14d2a210fab1
patch 8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys
Bram Moolenaar <Bram@vim.org>
parents:
18709
diff
changeset
|
2470 endfunc |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
2471 |
28053
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2472 func Test_mapping_esc() |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2473 set timeoutlen=10 |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2474 |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2475 new |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2476 nnoremap <Up> iHello<Esc> |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2477 nnoremap <Esc> <Nop> |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2478 |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2479 call feedkeys(substitute(&t_ku, '\*', '', 'g'), 'Lx!') |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2480 call assert_equal("Hello", getline(1)) |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2481 |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2482 bwipe! |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2483 nunmap <Up> |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2484 nunmap <Esc> |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2485 set timeoutlen& |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2486 endfunc |
f615d89a5351
patch 8.2.4551: when mapping <Esc> terminal codes are not recognized
Bram Moolenaar <Bram@vim.org>
parents:
27958
diff
changeset
|
2487 |
20313
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2488 " Test for translation of special key codes (<xF1>, <xF2>, etc.) |
23774
646ca2893d85
patch 8.2.2428: FocusGained does not work when 'ttymouse' is empty
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
2489 func Test_Keycode_Translation() |
20313
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2490 let keycodes = [ |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2491 \ ["<xUp>", "<Up>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2492 \ ["<xDown>", "<Down>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2493 \ ["<xLeft>", "<Left>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2494 \ ["<xRight>", "<Right>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2495 \ ["<xHome>", "<Home>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2496 \ ["<xEnd>", "<End>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2497 \ ["<zHome>", "<Home>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2498 \ ["<zEnd>", "<End>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2499 \ ["<xF1>", "<F1>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2500 \ ["<xF2>", "<F2>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2501 \ ["<xF3>", "<F3>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2502 \ ["<xF4>", "<F4>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2503 \ ["<S-xF1>", "<S-F1>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2504 \ ["<S-xF2>", "<S-F2>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2505 \ ["<S-xF3>", "<S-F3>"], |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2506 \ ["<S-xF4>", "<S-F4>"]] |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2507 for [k1, k2] in keycodes |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2508 exe "nnoremap " .. k1 .. " 2wx" |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2509 call assert_true(maparg(k1, 'n', 0, 1).lhs == k2) |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2510 exe "nunmap " .. k1 |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2511 endfor |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2512 endfunc |
244eb8d8d100
patch 8.2.0712: various code not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
2513 |
24204
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2514 " Test for terminal keycodes that doesn't have termcap entries |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2515 func Test_special_term_keycodes() |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2516 new |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2517 " Test for <xHome>, <S-xHome> and <C-xHome> |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2518 " send <K_SPECIAL> <KS_EXTRA> keycode |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2519 call feedkeys("i\<C-K>\x80\xfd\x3f\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2520 " send <K_SPECIAL> <KS_MODIFIER> bitmap <K_SPECIAL> <KS_EXTRA> keycode |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2521 call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3f\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2522 call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3f\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2523 " Test for <xEnd>, <S-xEnd> and <C-xEnd> |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2524 call feedkeys("i\<C-K>\x80\xfd\x3d\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2525 call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3d\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2526 call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3d\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2527 " Test for <zHome>, <S-zHome> and <C-zHome> |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2528 call feedkeys("i\<C-K>\x80\xfd\x40\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2529 call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x40\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2530 call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x40\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2531 " Test for <zEnd>, <S-zEnd> and <C-zEnd> |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2532 call feedkeys("i\<C-K>\x80\xfd\x3e\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2533 call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3e\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2534 call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3e\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2535 " Test for <xUp>, <xDown>, <xLeft> and <xRight> |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2536 call feedkeys("i\<C-K>\x80\xfd\x41\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2537 call feedkeys("i\<C-K>\x80\xfd\x42\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2538 call feedkeys("i\<C-K>\x80\xfd\x43\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2539 call feedkeys("i\<C-K>\x80\xfd\x44\n", 'xt') |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2540 call assert_equal(['<Home>', '<S-Home>', '<C-Home>', |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2541 \ '<End>', '<S-End>', '<C-End>', |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2542 \ '<Home>', '<S-Home>', '<C-Home>', |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2543 \ '<End>', '<S-End>', '<C-End>', |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2544 \ '<Up>', '<Down>', '<Left>', '<Right>', ''], getline(1, '$')) |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2545 bw! |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2546 endfunc |
ec71c859e94c
patch 8.2.2643: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
23774
diff
changeset
|
2547 |
31111
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2548 func Test_home_key_works() |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2549 " The '@' character in K_HOME must only match "1" when followed by ";", |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2550 " otherwise this code for Home is not recognized: "<Esc>[1~" |
31123
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2551 " Set termcap values like "xterm" uses them. Except using F2 for xHome, |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2552 " because that termcap entry can't be set here. |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2553 let save_K1 = exists('&t_K1') ? &t_K1 : '' |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2554 let save_kh = exists('&t_kh') ? &t_kh : '' |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2555 let save_k2 = exists('&t_k2') ? &t_k2 : '' |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2556 let save_k3 = exists('&t_k3') ? &t_k3 : '' |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2557 let save_end = exists('&t_@7') ? &t_@7 : '' |
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2558 |
31111
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2559 let &t_K1 = "\<Esc>[1;*~" " <kHome> |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2560 let &t_kh = "\<Esc>[@;*H" " <Home> |
31123
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2561 let &t_k2 = "\<Esc>O*H" " use <F2> for <xHome> |
31111
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2562 let &t_k3 = "\<Esc>[7;*~" " use <F3> for <zHome> |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2563 let &t_@7 = "\<Esc>[@;*F" " <End> |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2564 |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2565 new |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2566 call feedkeys("i\<C-K>\<Esc>OH\n\<Esc>", 'tx') |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2567 call feedkeys("i\<C-K>\<Esc>[1~\n\<Esc>", 'tx') |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2568 call assert_equal([ |
31123
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2569 \ '<F2>', |
31111
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2570 \ '<kHome>', |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2571 \ ''], getline(1, '$')) |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2572 |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2573 bwipe! |
31123
c74358443098
patch 9.0.0896: test for home key fails when 'term' is "tmux"
Bram Moolenaar <Bram@vim.org>
parents:
31111
diff
changeset
|
2574 let &t_K1 = save_K1 |
31111
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2575 let &t_kh = save_kh |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2576 let &t_k2 = save_k2 |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2577 let &t_k3 = save_k3 |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2578 let &t_@7 = save_end |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2579 endfunc |
f1cb6b4dbf72
patch 9.0.0890: no test for what patch 9.0.0827 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
2580 |
25429
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2581 func Test_terminal_builtin_without_gui() |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2582 CheckNotMSWindows |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2583 |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2584 " builtin_gui should not be output by :set term=xxx |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2585 let output = systemlist("TERM=dumb " .. v:progpath .. " --clean -c ':set t_ti= t_te=' -c 'set term=xxx' -c ':q!'") |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2586 redraw! |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2587 call map(output, {_, val -> trim(val)}) |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2588 call assert_equal(-1, index(output, 'builtin_gui')) |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2589 call assert_notequal(-1, index(output, 'builtin_dumb')) |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2590 endfunc |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2591 |
2aefea114696
patch 8.2.3251: listing builtin_gui as an available terminal is confusing
Bram Moolenaar <Bram@vim.org>
parents:
24204
diff
changeset
|
2592 |
19657
da791e5c0139
patch 8.2.0385: menu functionality insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18918
diff
changeset
|
2593 " vim: shiftwidth=2 sts=2 expandtab |