annotate src/testdir/test_modeless.vim @ 35172:c98f002b1fe4 default tip

runtime(doc): fix typo in usr_52.txt Commit: https://github.com/vim/vim/commit/b7258738f80f26be302a84a99f968b3bdc2f29bb Author: Christian Brabandt <cb@256bit.org> Date: Sun May 12 19:04:47 2024 +0200 runtime(doc): fix typo in usr_52.txt fixes: https://github.com/vim/vim/issues/14758 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 12 May 2024 19:15:08 +0200
parents ee50174810ac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Test for modeless selection
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " This only works for Unix in a terminal
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 source check.vim
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 CheckNotGui
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 CheckUnix
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7
31241
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
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:
diff changeset
9 source mouse.vim
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 " Test for modeless characterwise selection (single click)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 func Test_modeless_characterwise_selection()
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 CheckFeature clipboard_working
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let save_mouse = &mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 let save_term = &term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 let save_ttymouse = &ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 call test_override('no_query_mouse', 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 set mouse=a term=xterm mousetime=200
31241
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
19 call WaitForResponses()
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
20
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 new
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 call setline(1, ['one two three', 'foo bar baz'])
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 redraw!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
31241
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
25 " Wait a bit for any terminal responses to get processed.
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
26 sleep 50m
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
27
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let msg = 'ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 exe 'set ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 " select multiple characters within a line
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
33 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 let keys ..= MouseLeftDragCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 let keys ..= MouseLeftReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 call assert_equal("wo th", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 " select multiple characters including the end of line
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
45 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 let keys ..= MouseLeftClickCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 let keys ..= MouseLeftDragCode(1, 16)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 let keys ..= MouseLeftReleaseCode(1, 16)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 call assert_equal("ree\n", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 " extend a selection using right mouse click
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
57 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 set mousemodel=extend
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 let keys ..= MouseLeftClickCode(1, 2)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 let keys ..= MouseLeftDragCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 let keys ..= MouseLeftReleaseCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 let keys ..= MouseRightClickCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 let keys ..= MouseRightReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 call assert_equal("ne two th", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 set mousemodel&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 " extend a selection backwards using right mouse click
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
73 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 set mousemodel=extend
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 let keys ..= MouseLeftClickCode(1, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 let keys ..= MouseLeftDragCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 let keys ..= MouseLeftReleaseCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 let keys ..= MouseRightClickCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 let keys ..= MouseRightReleaseCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 call assert_equal("e two thr", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 set mousemodel&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 " select multiple characters within a line backwards
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
89 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 let keys ..= MouseLeftClickCode(1, 9)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 let keys ..= MouseLeftDragCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 let keys ..= MouseLeftReleaseCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 call assert_equal("e two t", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 " select multiple characters across lines with (end row > start row) and
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 " (end column < start column)
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
102 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 let keys ..= MouseLeftClickCode(1, 9)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 let keys ..= MouseLeftDragCode(2, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 let keys ..= MouseLeftReleaseCode(2, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 call assert_equal("three\nfoo", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 " select multiple characters across lines with (end row > start row) and
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 " (end column > start column)
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
115 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 let keys ..= MouseLeftClickCode(1, 4)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 let keys ..= MouseLeftDragCode(2, 8)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 let keys ..= MouseLeftReleaseCode(2, 8)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 call assert_equal(" two three\nfoo bar ", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 " select multiple characters across lines with (end row < start row) and
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 " (end column < start column)
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
128 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 let keys ..= MouseLeftClickCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 let keys ..= MouseLeftDragCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 let keys ..= MouseLeftReleaseCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 call assert_equal("two three\nfoo bar", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 " select multiple characters across lines with (end row < start row) and
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 " (end column > start column)
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
141 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 let keys ..= MouseLeftClickCode(2, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 let keys ..= MouseLeftDragCode(1, 13)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 let keys ..= MouseLeftReleaseCode(1, 13)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 call assert_equal("e\nfoo bar baz", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 " select multiple characters across lines with (end row < start row) and
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 " the end column is greater than the line length
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
154 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 let keys ..= MouseLeftClickCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 let keys ..= MouseLeftDragCode(1, 16)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 let keys ..= MouseLeftReleaseCode(1, 16)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163 call assert_equal("\nfoo bar", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 " select multiple characters across lines with start/end row and start/end
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 " column outside the lines in the buffer
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
167 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 let keys ..= MouseLeftClickCode(4, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 let keys ..= MouseLeftDragCode(3, 2)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173 let keys ..= MouseLeftReleaseCode(3, 2)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176 call assert_equal("\n~ ", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 " change selection using right mouse click within the selected text
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
179 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
182 set mousemodel=extend
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
183 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
184 let keys ..= MouseLeftClickCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
185 let keys ..= MouseLeftDragCode(1, 13)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
186 let keys ..= MouseLeftReleaseCode(1, 13)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
187 let keys ..= MouseRightClickCode(1, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
188 let keys ..= MouseRightReleaseCode(1, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
189 let keys ..= MouseRightClickCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
190 let keys ..= MouseRightReleaseCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
191 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
192 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
193 call assert_equal("o thr", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
194 set mousemodel&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
195
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
196 " select text multiple times at different places
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
197 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
198 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
199 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
200 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
201 let keys ..= MouseLeftClickCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
202 let keys ..= MouseLeftDragCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
203 let keys ..= MouseLeftReleaseCode(1, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
204 let keys ..= MouseLeftClickCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
205 let keys ..= MouseLeftDragCode(2, 9)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
206 let keys ..= MouseLeftReleaseCode(2, 9)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
208 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
209 call assert_equal("r b", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
211 " Test for 'clipboard' set to 'autoselectml' to automatically copy the
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212 " modeless selection to the clipboard
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
213 set clipboard=autoselectml
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
214 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
215 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
216 let keys ..= MouseLeftClickCode(2, 5)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 let keys ..= MouseLeftDragCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
218 let keys ..= MouseLeftReleaseCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
219 let keys ..= "\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 call assert_equal("bar", @*)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
222 set clipboard&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
223
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
224 " quadruple click should start characterwise selectmode
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
225 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
226 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
227 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
228 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
229 let keys ..= MouseLeftClickCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
230 let keys ..= MouseLeftReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
231 let keys ..= MouseLeftClickCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
232 let keys ..= MouseLeftReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
233 let keys ..= MouseLeftClickCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
234 let keys ..= MouseLeftReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
235 let keys ..= MouseLeftClickCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
236 let keys ..= MouseLeftDragCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
237 let keys ..= MouseLeftReleaseCode(1, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
238 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
239 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
240 call assert_equal("hree", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
241 endfor
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
242
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
243 let &mouse = save_mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
244 let &term = save_term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
245 let &ttymouse = save_ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
246 set mousetime&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
247 call test_override('no_query_mouse', 0)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
248 close!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
249 endfunc
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
250
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
251 " Test for modeless word selection (double click)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
252 func Test_modeless_word_selection()
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
253 CheckFeature clipboard_working
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
254 let save_mouse = &mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
255 let save_term = &term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
256 let save_ttymouse = &ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
257 call test_override('no_query_mouse', 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
258 set mouse=a term=xterm mousetime=200
31241
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
259 call WaitForResponses()
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
260
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
261 new
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
262 call setline(1, ['one two three', 'foo bar baz'])
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
263 redraw!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
264
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
265 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
266 let msg = 'ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
267 exe 'set ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
268
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
269 " select multiple words within a line
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
270 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
271 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
272 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
273 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
274 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
275 let keys ..= MouseLeftReleaseCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
276 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
277 let keys ..= MouseLeftDragCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
278 let keys ..= MouseLeftReleaseCode(1, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
279 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
280 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
281 call assert_equal("two three", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
282
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
283 " select a single word
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
284 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
285 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
286 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
287 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
288 let keys ..= MouseLeftClickCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
289 let keys ..= MouseLeftReleaseCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
290 let keys ..= MouseLeftClickCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
291 let keys ..= MouseLeftReleaseCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
292 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
293 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
294 call assert_equal("bar", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
295
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
296 " select multiple words backwards within a line
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
297 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
298 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
299 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
300 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
301 let keys ..= MouseLeftClickCode(2, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
302 let keys ..= MouseLeftReleaseCode(2, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
303 let keys ..= MouseLeftClickCode(2, 11)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
304 let keys ..= MouseLeftDragCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
305 let keys ..= MouseLeftReleaseCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
306 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
307 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
308 call assert_equal("bar baz", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
309
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
310 " select multiple words backwards across lines
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
311 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
312 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
313 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
314 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
315 let keys ..= MouseLeftClickCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
316 let keys ..= MouseLeftReleaseCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
317 let keys ..= MouseLeftClickCode(2, 7)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
318 let keys ..= MouseLeftDragCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
319 let keys ..= MouseLeftReleaseCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
320 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
321 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
322 call assert_equal("two three\nfoo bar", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
323 endfor
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
324
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
325 let &mouse = save_mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
326 let &term = save_term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
327 let &ttymouse = save_ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
328 set mousetime&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
329 call test_override('no_query_mouse', 0)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
330 close!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
331 endfunc
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
332
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
333 " Test for modeless line selection (triple click)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
334 func Test_modeless_line_selection()
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
335 CheckFeature clipboard_working
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
336 let save_mouse = &mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
337 let save_term = &term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
338 let save_ttymouse = &ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
339 call test_override('no_query_mouse', 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
340 set mouse=a term=xterm mousetime=200
31241
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
341 call WaitForResponses()
ee50174810ac patch 9.0.0954: cannot detect whether modifyOtherKeys is enabled
Bram Moolenaar <Bram@vim.org>
parents: 20365
diff changeset
342
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
343 new
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
344 call setline(1, ['one two three', 'foo bar baz'])
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
345 redraw!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
346
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
347 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
348 let msg = 'ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
349 exe 'set ttymouse=' .. ttymouse_val
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
350
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
351 " select single line
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
352 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
353 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
354 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
355 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
356 let keys ..= MouseLeftClickCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
357 let keys ..= MouseLeftReleaseCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
358 let keys ..= MouseLeftClickCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
359 let keys ..= MouseLeftReleaseCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
360 let keys ..= MouseLeftClickCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
361 let keys ..= MouseLeftReleaseCode(2, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
362 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
363 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
364 call assert_equal("foo bar baz\n", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
365
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
366 " select multiple lines
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
367 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
368 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
369 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
370 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
371 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
372 let keys ..= MouseLeftReleaseCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
373 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
374 let keys ..= MouseLeftReleaseCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
375 let keys ..= MouseLeftClickCode(1, 6)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
376 let keys ..= MouseLeftDragCode(2, 12)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
377 let keys ..= MouseLeftReleaseCode(2, 12)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
378 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
379 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
380 call assert_equal("one two three\nfoo bar baz\n", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
381
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
382 " select multiple lines backwards
20365
6bcd12791bf1 patch 8.2.0738: mouse handling in a terminal window not well tested
Bram Moolenaar <Bram@vim.org>
parents: 19738
diff changeset
383 let @* = 'clean'
19738
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
384 call MouseRightClick(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
385 call MouseRightRelease(1, 1)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
386 let keys = ":"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
387 let keys ..= MouseLeftClickCode(2, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
388 let keys ..= MouseLeftReleaseCode(2, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
389 let keys ..= MouseLeftClickCode(2, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
390 let keys ..= MouseLeftReleaseCode(2, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
391 let keys ..= MouseLeftClickCode(2, 10)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
392 let keys ..= MouseLeftDragCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
393 let keys ..= MouseLeftReleaseCode(1, 3)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
394 let keys ..= "\<C-Y>\<CR>"
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
395 call feedkeys(keys, "x")
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
396 call assert_equal("one two three\nfoo bar baz\n", @*, msg)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
397 endfor
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
398
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
399 let &mouse = save_mouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
400 let &term = save_term
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
401 let &ttymouse = save_ttymouse
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
402 set mousetime&
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
403 call test_override('no_query_mouse', 0)
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
404 close!
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
405 endfunc
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
406
0208534b8a84 patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
407 " vim: shiftwidth=2 sts=2 expandtab