Mercurial > vim
annotate src/testdir/test_selectmode.vim @ 20437:3bb4dea4a164 v8.2.0773
patch 8.2.0773: switching to raw mode every time ":" is used
Commit: https://github.com/vim/vim/commit/3b1f18f785f67c6cd110498c366e4d0c0fe11f27
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 16 23:15:08 2020 +0200
patch 8.2.0773: switching to raw mode every time ":" is used
Problem: Switching to raw mode every time ":" is used.
Solution: When executing a shell set cur_tmode to TMODE_UNKNOWN, so that the
next time TMODE_RAW is used it is set, but not every time.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 16 May 2020 23:30:03 +0200 |
parents | 0208534b8a84 |
children | 505d97ea54da |
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 Select-mode |
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 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 source mouse.vim |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 " Test for select mode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 func Test_selectmode_basic() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 call setline(1, range(1,100)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 50 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 norm! gHy |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 call assert_equal('y51', getline('.')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 call setline(1, range(1,100)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 50 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 exe ":norm! V9jo\<c-g>y" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 call assert_equal('y60', getline('.')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 call setline(1, range(1,100)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 50 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 call feedkeys(":set im\n\<c-o>gHc\<c-o>:set noim\n", 'tx') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 call assert_equal('c51', getline('.')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 " clean up |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 bw! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 " Test for starting selectmode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 func Test_selectmode_start() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 set selectmode=key keymodel=startsel |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 call setline(1, ['abc', 'def', 'ghi']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 call cursor(1, 4) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 call feedkeys("A\<s-home>start\<esc>", 'txin') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 call assert_equal(['startdef', 'ghi'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 " start select mode again with gv |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 set selectmode=cmd |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 call feedkeys('gvabc', 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 call assert_equal('abctdef', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 set selectmode= keymodel= |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 bw! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 " Test for characterwise select mode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 func Test_characterwise_select_mode() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 " Select mode maps |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 snoremap <lt>End> <End> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 snoremap <lt>Down> <Down> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 snoremap <lt>Del> <Del> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 " characterwise select mode: delete middle line |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 exe "normal Gkkgh\<End>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 call assert_equal(['', 'b', 'c'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 " characterwise select mode: delete middle two lines |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 exe "normal Gkkgh\<Down>\<End>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 call assert_equal(['', 'c'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 " characterwise select mode: delete last line |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 exe "normal Ggh\<End>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 call assert_equal(['', 'a', 'b', ''], getline(1, '$')) |
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 " characterwise select mode: delete last two lines |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 exe "normal Gkgh\<Down>\<End>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 call assert_equal(['', 'a', ''], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 " CTRL-H in select mode behaves like 'x' |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 call setline(1, 'abcdef') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 exe "normal! gggh\<Right>\<Right>\<Right>\<C-H>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 call assert_equal('ef', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 " CTRL-O in select mode switches to visual mode for one command |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 call setline(1, 'abcdef') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 exe "normal! gggh\<C-O>3lm" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 call assert_equal('mef', getline(1)) |
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 sunmap <lt>End> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 sunmap <lt>Down> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 sunmap <lt>Del> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 bwipe! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 " Test for linewise select mode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 func Test_linewise_select_mode() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 " linewise select mode: delete middle line |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 exe "normal GkkgH\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 call assert_equal(['', 'b', 'c'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 " linewise select mode: delete middle two lines |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 exe "normal GkkgH\<Down>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 call assert_equal(['', 'c'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 " linewise select mode: delete last line |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 exe "normal GgH\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 call assert_equal(['', 'a', 'b'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
115 " linewise select mode: delete last two lines |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 call deletebufline('', 1, '$') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 call append('$', ['a', 'b', 'c']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 exe "normal GkgH\<Down>\<Del>" |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
119 call assert_equal(['', 'a'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
120 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 bwipe! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
122 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
123 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
124 " Test for blockwise select mode (g CTRL-H) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
125 func Test_blockwise_select_mode() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
126 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
127 call setline(1, ['foo', 'bar']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
128 call feedkeys("g\<BS>\<Right>\<Down>mm", 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
129 call assert_equal(['mmo', 'mmr'], getline(1, '$')) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
130 close! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
131 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
132 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
133 " Test for using visual mode maps in select mode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
134 func Test_select_mode_map() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
135 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
136 vmap <buffer> <F2> 3l |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
137 call setline(1, 'Test line') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
138 call feedkeys("gh\<F2>map", 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
139 call assert_equal('map line', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
140 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
141 vmap <buffer> <F2> ygV |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
142 call feedkeys("0gh\<Right>\<Right>\<F2>cwabc", 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
143 call assert_equal('abc line', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
144 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
145 vmap <buffer> <F2> :<C-U>let v=100<CR> |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
146 call feedkeys("gggh\<Right>\<Right>\<F2>foo", 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
147 call assert_equal('foo line', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
148 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
149 " reselect the select mode using gv from a visual mode map |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
150 vmap <buffer> <F2> gv |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 set selectmode=cmd |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
152 call feedkeys("0gh\<F2>map", 'xt') |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
153 call assert_equal('map line', getline(1)) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
154 set selectmode& |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
155 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
156 close! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
157 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
158 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
159 " Test double/triple/quadruple click to start 'select' mode |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
160 func Test_term_mouse_multiple_clicks_to_select_mode() |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
161 let save_mouse = &mouse |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
162 let save_term = &term |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
163 let save_ttymouse = &ttymouse |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
164 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
|
165 set mouse=a term=xterm mousetime=200 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
166 set selectmode=mouse |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
167 new |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
168 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
169 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
|
170 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
|
171 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
|
172 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
173 " Single-click and drag should 'select' the characters |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
174 call setline(1, ['foo [foo bar] foo', 'foo']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
175 call MouseLeftClick(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
176 call assert_equal(0, getcharmod(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
177 call MouseLeftDrag(1, 13) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
178 call MouseLeftRelease(1, 13) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
179 norm! o |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
180 call assert_equal(['foo foo', 'foo'], getline(1, '$'), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
181 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
182 " Double-click on word should visually 'select' the word. |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
183 call setline(1, ['foo [foo bar] foo', 'foo']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
184 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
185 call assert_equal(0, getcharmod(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
186 call MouseLeftRelease(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
188 call assert_equal(32, getcharmod(), msg) " double-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
189 call MouseLeftRelease(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
190 call assert_equal('s', mode(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
191 norm! bar |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
192 call assert_equal(['bar [foo bar] foo', 'foo'], getline(1, '$'), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
193 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
194 " Double-click on opening square bracket should visually |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
195 " 'select' the whole [foo bar]. |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
196 call setline(1, ['foo [foo bar] foo', 'foo']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
197 call MouseLeftClick(1, 5) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
198 call assert_equal(0, getcharmod(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
199 call MouseLeftRelease(1, 5) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
200 call MouseLeftClick(1, 5) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
201 call assert_equal(32, getcharmod(), msg) " double-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
202 call MouseLeftRelease(1, 5) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
203 call assert_equal('s', mode(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
204 norm! bar |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
205 call assert_equal(['foo bar foo', 'foo'], getline(1, '$'), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
206 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
207 " To guarantee that the next click is not counted as a triple click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
208 call MouseRightClick(1, 1) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
209 call MouseRightRelease(1, 1) |
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 " Triple-click should visually 'select' the whole line. |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
212 call setline(1, ['foo [foo bar] foo', 'foo']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
213 call MouseLeftClick(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
214 call assert_equal(0, getcharmod(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 call MouseLeftRelease(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 call MouseLeftClick(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 call assert_equal(32, getcharmod(), msg) " double-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
218 call MouseLeftRelease(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 call MouseLeftClick(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 call assert_equal(64, getcharmod(), msg) " triple-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 call MouseLeftRelease(1, 3) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 call assert_equal('S', mode(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
223 norm! baz |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
224 call assert_equal(['bazfoo'], getline(1, '$'), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
225 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
226 " Quadruple-click should start visual block 'select'. |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
227 call setline(1, ['aaaaaa', 'bbbbbb']) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
228 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
229 call assert_equal(0, getcharmod(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
230 call MouseLeftRelease(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
231 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
232 call assert_equal(32, getcharmod(), msg) " double-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
233 call MouseLeftRelease(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
234 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
235 call assert_equal(64, getcharmod(), msg) " triple-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
236 call MouseLeftRelease(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
237 call MouseLeftClick(1, 2) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
238 call assert_equal(96, getcharmod(), msg) " quadruple-click |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
239 call MouseLeftDrag(2, 4) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
240 call MouseLeftRelease(2, 4) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
241 call assert_equal("\<c-s>", mode(), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
242 norm! x |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
243 call assert_equal(['axaa', 'bxbb'], getline(1, '$'), msg) |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
244 endfor |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
245 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
246 let &mouse = save_mouse |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
247 let &term = save_term |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
248 let &ttymouse = save_ttymouse |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
249 set mousetime& |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
250 set selectmode& |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
251 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
|
252 bwipe! |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
253 endfunc |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
254 |
0208534b8a84
patch 8.2.0425: code for modeless selection not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
255 " vim: shiftwidth=2 sts=2 expandtab |