Mercurial > vim
annotate src/testdir/test_normal.vim @ 19922:1f42c49c3d29 v8.2.0517
patch 8.2.0517: Vim9: cannot separate "func" and "func(): void"
Commit: https://github.com/vim/vim/commit/4c68375057c25e99656bc996d3fa5c6b0b6a7e6a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 5 21:38:23 2020 +0200
patch 8.2.0517: Vim9: cannot separate "func" and "func(): void"
Problem: Vim9: cannot separate "func" and "func(): void".
Solution: Use VAR_ANY for "any" and VAR_UNKNOWN for "no type".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Apr 2020 21:45:25 +0200 |
parents | 12518b40c161 |
children | 2c4d9ca33769 |
rev | line source |
---|---|
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for various Normal mode commands |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
3 source shared.vim |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18736
diff
changeset
|
4 source check.vim |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
5 source view_util.vim |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
6 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
7 func Setup_NewWindow() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call setline(1, range(1,100)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 endfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
12 func MyFormatExpr() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 " Adds '->$' at lines having numbers followed by trailing whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 for ln in range(v:lnum, v:lnum+v:count-1) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 let line = getline(ln) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 if getline(ln) =~# '\d\s\+$' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call setline(ln, substitute(line, '\s\+$', '', '') . '->$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfor |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
20 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
22 func CountSpaces(type, ...) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 " for testing operatorfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 " will count the number of spaces |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " and return the result in g:a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let sel_save = &selection |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 let &selection = "inclusive" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let reg_save = @@ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 if a:0 " Invoked from Visual mode, use gv command. |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 silent exe "normal! gvy" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 elseif a:type == 'line' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 silent exe "normal! '[V']y" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 else |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 silent exe "normal! `[v`]y" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 let g:a=strlen(substitute(@@, '[^ ]', '', 'g')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 let &selection = sel_save |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 let @@ = reg_save |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
40 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
41 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
42 func OpfuncDummy(type, ...) |
10342
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
43 " for testing operatorfunc |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
44 let g:opt=&linebreak |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
45 |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
46 if a:0 " Invoked from Visual mode, use gv command. |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
47 silent exe "normal! gvy" |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
48 elseif a:type == 'line' |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
49 silent exe "normal! '[V']y" |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
50 else |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
51 silent exe "normal! `[v`]y" |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
52 endif |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
53 " Create a new dummy window |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
54 new |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
55 let g:bufnr=bufnr('%') |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
56 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
58 func Test_normal00_optrans() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 call append(0, ['1 This is a simple test: abcd', '2 This is the second line', '3 this is the third line']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 exe "norm! Sfoobar\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal(['foobar', '2 This is the second line', '3 this is the third line', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 exe "norm! $vbsone" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 call assert_equal(['foobar', '2 This is the second one', '3 this is the third line', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 norm! VS Second line here |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 call assert_equal(['foobar', ' Second line here', '3 this is the third line', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call append(0, ['4 This is a simple test: abcd', '5 This is the second line', '6 this is the third line']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 call append(0, ['1 This is a simple test: abcd', '2 This is the second line', '3 this is the third line']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 norm! 2D |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 call assert_equal(['3 this is the third line', '4 This is a simple test: abcd', '5 This is the second line', '6 this is the third line', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 set cpo+=# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 norm! 4D |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 call assert_equal(['', '4 This is a simple test: abcd', '5 This is the second line', '6 this is the third line', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 set cpo-=# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
83 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
85 func Test_normal01_keymodel() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 " Test 1: depending on 'keymodel' <s-down> does something different |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
88 50 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 call feedkeys("V\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 call assert_equal(['47', '48', '49', '50'], getline("'<", "'>")) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
91 set keymodel=startsel |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
92 50 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 call feedkeys("V\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 call assert_equal(['49', '50'], getline("'<", "'>")) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 " Start visual mode when keymodel = startsel |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
96 50 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 call feedkeys("\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 call assert_equal(['49', '5'], getreg(0, 0, 1)) |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
99 " Use the different Shift special keys |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
100 50 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
101 call feedkeys("\<S-Right>\<S-Left>\<S-Up>\<S-Down>\<S-Home>\<S-End>y", 'tx') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
102 call assert_equal(['50'], getline("'<", "'>")) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
103 call assert_equal(['50', ''], getreg(0, 0, 1)) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
104 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 " Do not start visual mode when keymodel= |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
106 set keymodel= |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
107 50 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 call feedkeys("\<S-Up>y$", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal(['42'], getreg(0, 0, 1)) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
110 " Stop visual mode when keymodel=stopsel |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
111 set keymodel=stopsel |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
112 50 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
113 call feedkeys("Vkk\<Up>yy", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
114 call assert_equal(['47'], getreg(0, 0, 1)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
115 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
116 set keymodel= |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
117 50 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
118 call feedkeys("Vkk\<Up>yy", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
119 call assert_equal(['47', '48', '49', '50'], getreg(0, 0, 1)) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 endfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
125 func Test_normal03_join() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 " basic join test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 norm! VJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 call assert_equal('50 51', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 norm! J |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 call assert_equal('100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 norm! V9-gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 call assert_equal('919293949596979899100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 call setline(1, range(1,100)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 :j 10 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 call assert_equal('100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
143 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
145 func Test_normal04_filter() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 " basic filter test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 " only test on non windows platform |
10342
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
148 if has('win32') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call feedkeys("!!sed -e 's/^/| /'\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 call assert_equal('| 1', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 90 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 :sil :!echo one |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 call feedkeys('.', 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 call assert_equal('| 90', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 95 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 set cpo+=! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 " 2 <CR>, 1: for executing the command, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 " 2: clear hit-enter-prompt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 call feedkeys("!!\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call feedkeys(":!echo one\n\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 call feedkeys(".", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call assert_equal('one', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 set cpo-=! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
169 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
171 func Test_normal05_formatexpr() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 " basic formatexpr test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 %d_ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 call setline(1, ['here: 1 ', '2', 'here: 3 ', '4', 'not here: ']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 set formatexpr=MyFormatExpr() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 norm! gqG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 call assert_equal(['here: 1->$', '2', 'here: 3->$', '4', 'not here: '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 set formatexpr= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
182 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 |
10104
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
184 func Test_normal05_formatexpr_newbuf() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
185 " Edit another buffer in the 'formatexpr' function |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
186 new |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
187 func! Format() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
188 edit another |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
189 endfunc |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
190 set formatexpr=Format() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
191 norm gqG |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
192 bw! |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
193 set formatexpr= |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
194 endfunc |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
195 |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
196 func Test_normal05_formatexpr_setopt() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
197 " Change the 'formatexpr' value in the function |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
198 new |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
199 func! Format() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
200 set formatexpr= |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
201 endfunc |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
202 set formatexpr=Format() |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
203 norm gqG |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
204 bw! |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
205 set formatexpr= |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
206 endfunc |
b2dbe79639a2
commit https://github.com/vim/vim/commit/d77f9d595eb5f301b39b4373f2900a13c0ca30e2
Christian Brabandt <cb@256bit.org>
parents:
10102
diff
changeset
|
207 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
208 func Test_normal06_formatprg() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 " basic test for formatprg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 " only test on non windows platform |
10342
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
211 if has('win32') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
212 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 endif |
10579
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
214 |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
215 " uses sed to number non-empty lines |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
216 call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh') |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
217 call system('chmod +x ./Xsed_format.sh') |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
218 let text = ['a', '', 'c', '', ' ', 'd', 'e'] |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
219 let expected = ['1 a', '', '3 c', '', '5 ', '6 d', '7 e'] |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
220 |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
221 10new |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
222 call setline(1, text) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 set formatprg=./Xsed_format.sh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 norm! gggqG |
10579
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
225 call assert_equal(expected, getline(1, '$')) |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
226 bw! |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
227 |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
228 10new |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
229 call setline(1, text) |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
230 set formatprg=donothing |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
231 setlocal formatprg=./Xsed_format.sh |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
232 norm! gggqG |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
233 call assert_equal(expected, getline(1, '$')) |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
234 bw! |
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
235 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 set formatprg= |
10579
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
238 setlocal formatprg= |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 call delete('Xsed_format.sh') |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
240 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
242 func Test_normal07_internalfmt() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
243 " basic test for internal formmatter to textwidth of 12 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 let list=range(1,11) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 call map(list, 'v:val." "') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
246 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 call setline(1, list) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 set tw=12 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 norm! gggqG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 call assert_equal(['1 2 3', '4 5 6', '7 8 9', '10 11 '], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 " clean up |
10579
688b97124d23
patch 8.0.0179: cannot have a local value for 'formatprg'
Christian Brabandt <cb@256bit.org>
parents:
10342
diff
changeset
|
252 set tw=0 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
253 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
254 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
256 func Test_normal08_fold() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
257 " basic tests for foldopen/folddelete |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
258 if !has("folding") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
259 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
260 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
261 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
262 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
263 setl foldenable fdm=marker |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 " First fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 norm! V4jzf |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
267 call assert_equal(['50/*{{{*/', '51', '52', '53', '54/*}}}*/'], getline(50,54)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 " Second fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
269 46 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
270 norm! V10jzf |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
271 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
272 call assert_equal('46/*{{{*/', getline(46)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
273 call assert_equal('60/*}}}*/', getline(60)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
274 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
275 call assert_equal('45', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 call assert_equal('61', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
281 " open a fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 norm! Vzo |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
284 call assert_equal('45', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
287 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
288 call assert_equal('47', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
290 norm! zcVzO |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
291 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
293 call assert_equal('47', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
294 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
295 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
296 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
298 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
299 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
300 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
301 call assert_equal('51', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
302 " delete folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
303 :46 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 " collapse fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 norm! V14jzC |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
306 " delete all folds recursively |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 norm! VzD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 call assert_equal(['46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60'], getline(46,60)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
309 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
310 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
311 setl nofoldenable fdm=marker |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
312 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
313 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
314 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
315 func Test_normal09_operatorfunc() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
316 " Test operatorfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
317 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 " Add some spaces for counting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
319 50,60s/$/ / |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
320 unlet! g:a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
321 let g:a=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
322 nmap <buffer><silent> ,, :set opfunc=CountSpaces<CR>g@ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
323 vmap <buffer><silent> ,, :<C-U>call CountSpaces(visualmode(), 1)<CR> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
324 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
325 norm V2j,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
326 call assert_equal(6, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
327 norm V,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
328 call assert_equal(2, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
329 norm ,,l |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
330 call assert_equal(0, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
331 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
332 exe "norm 0\<c-v>10j2l,," |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
333 call assert_equal(11, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
334 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
335 norm V10j,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
336 call assert_equal(22, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
337 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
338 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
339 unmap <buffer> ,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
340 set opfunc= |
10342
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
341 unlet! g:a |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
342 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
343 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
344 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
345 func Test_normal09a_operatorfunc() |
10342
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
346 " Test operatorfunc |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
347 call Setup_NewWindow() |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
348 " Add some spaces for counting |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
349 50,60s/$/ / |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
350 unlet! g:opt |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
351 set linebreak |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
352 nmap <buffer><silent> ,, :set opfunc=OpfuncDummy<CR>g@ |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
353 50 |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
354 norm ,,j |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
355 exe "bd!" g:bufnr |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
356 call assert_true(&linebreak) |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
357 call assert_equal(g:opt, &linebreak) |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
358 set nolinebreak |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
359 norm ,,j |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
360 exe "bd!" g:bufnr |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
361 call assert_false(&linebreak) |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
362 call assert_equal(g:opt, &linebreak) |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
363 |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
364 " clean up |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
365 unmap <buffer> ,, |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
366 set opfunc= |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
367 bw! |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
368 unlet! g:opt |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
369 endfunc |
ae0faad76f9a
commit https://github.com/vim/vim/commit/4a08b0dc4dd70334056fc1bf069b5e938f2ed7d5
Christian Brabandt <cb@256bit.org>
parents:
10338
diff
changeset
|
370 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
371 func Test_normal10_expand() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
372 " Test for expand() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
373 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
374 call setline(1, ['1', 'ifooar,,cbar']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
375 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
376 norm! $ |
12421
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
377 call assert_equal('cbar', expand('<cword>')) |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
378 call assert_equal('ifooar,,cbar', expand('<cWORD>')) |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
379 |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
380 call setline(1, ['prx = list[idx];']) |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
381 1 |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
382 let expected = ['', 'prx', 'prx', 'prx', |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
383 \ 'list', 'list', 'list', 'list', 'list', 'list', 'list', |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
384 \ 'idx', 'idx', 'idx', 'idx', |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
385 \ 'list[idx]', |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
386 \ '];', |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
387 \ ] |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
388 for i in range(1, 16) |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
389 exe 'norm ' . i . '|' |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
390 call assert_equal(expected[i], expand('<cexpr>'), 'i == ' . i) |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
391 endfor |
da55ea30842c
patch 8.0.1090: cannot get the text under the cursor like v:beval_text
Christian Brabandt <cb@256bit.org>
parents:
11339
diff
changeset
|
392 |
13086
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
393 if executable('echo') |
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
394 " Test expand(`...`) i.e. backticks command expansion. |
18473
0eeaa9a6e4e7
patch 8.1.2230: MS-Windows: testing external commands can be improved
Bram Moolenaar <Bram@vim.org>
parents:
18291
diff
changeset
|
395 call assert_equal('abcde', expand('`echo abcde`')) |
13086
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
396 endif |
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
397 |
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
398 " Test expand(`=...`) i.e. backticks expression expansion |
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
399 call assert_equal('5', expand('`=2+3`')) |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
400 call assert_equal('3.14', expand('`=3.14`')) |
13086
4d2ee1564c97
patch 8.0.1418: no test for expanding backticks
Christian Brabandt <cb@256bit.org>
parents:
12788
diff
changeset
|
401 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
402 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
403 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
404 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
405 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
406 func Test_normal11_showcmd() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
407 " test for 'showcmd' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
408 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
409 exe "norm! ofoobar\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
410 call assert_equal(2, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
411 set showcmd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
412 exe "norm! ofoobar2\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
413 call assert_equal(3, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
414 exe "norm! VAfoobar3\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
415 call assert_equal(3, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
416 exe "norm! 0d3\<del>2l" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
417 call assert_equal('obar2foobar3', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
418 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
419 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
420 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
421 " Test for nv_error and normal command errors |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
422 func Test_normal12_nv_error() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
423 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
424 call setline(1, range(1,5)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
425 " should not do anything, just beep |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
426 call assert_beeps('exe "norm! <c-k>"') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
427 call assert_equal(map(range(1,5), 'string(v:val)'), getline(1,'$')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
428 call assert_beeps('normal! G2dd') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
429 call assert_beeps("normal! g\<C-A>") |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
430 call assert_beeps("normal! g\<C-X>") |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
431 call assert_beeps("normal! g\<C-B>") |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
432 call assert_beeps("normal! vQ\<Esc>") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
433 call assert_beeps("normal! 2[[") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
434 call assert_beeps("normal! 2]]") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
435 call assert_beeps("normal! 2[]") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
436 call assert_beeps("normal! 2][") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
437 call assert_beeps("normal! 4[z") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
438 call assert_beeps("normal! 4]z") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
439 call assert_beeps("normal! 4[c") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
440 call assert_beeps("normal! 4]c") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
441 call assert_beeps("normal! 200%") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
442 call assert_beeps("normal! %") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
443 call assert_beeps("normal! 2{") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
444 call assert_beeps("normal! 2}") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
445 call assert_beeps("normal! r\<Right>") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
446 call assert_beeps("normal! 8ry") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
447 call assert_beeps('normal! "@') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
448 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
449 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
450 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
451 func Test_normal13_help() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
452 " Test for F1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
453 call assert_equal(1, winnr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
454 call feedkeys("\<f1>", 'txi') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
455 call assert_match('help\.txt', bufname('%')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
456 call assert_equal(2, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
457 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
458 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
459 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
460 func Test_normal14_page() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
461 " basic test for Ctrl-F and Ctrl-B |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
462 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
463 exe "norm! \<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
464 call assert_equal('9', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
465 exe "norm! 2\<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
466 call assert_equal('25', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
467 exe "norm! 2\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
468 call assert_equal('18', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
469 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
470 set scrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
471 exe "norm! 2\<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
472 call assert_equal('21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
473 exe "norm! \<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
474 call assert_equal('13', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
475 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
476 set scrolloff=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
477 exe "norm! \<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
478 call assert_equal('13', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
479 set scrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
480 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
481 exe "norm! $\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
482 call assert_equal('92', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
483 call assert_equal([0, 92, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
484 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
485 set nostartofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
486 exe "norm! $\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
487 call assert_equal('92', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
488 call assert_equal([0, 92, 2, 0, 2147483647], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
489 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
490 set startofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
491 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
492 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
493 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
494 func Test_normal14_page_eol() |
10102
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
495 10new |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
496 norm oxxxxxxx |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
497 exe "norm 2\<c-f>" |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
498 " check with valgrind that cursor is put back in column 1 |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
499 exe "norm 2\<c-b>" |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
500 bw! |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
501 endfunc |
b80ad55d62d8
commit https://github.com/vim/vim/commit/bc54f3f3fed4dc3556df8c46cee6739d211b0eb2
Christian Brabandt <cb@256bit.org>
parents:
10092
diff
changeset
|
502 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
503 " Test for errors with z command |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
504 func Test_normal_z_error() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
505 call assert_beeps('normal! z2p') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
506 call assert_beeps('normal! zp') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
507 endfunc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
508 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
509 func Test_normal15_z_scroll_vert() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
510 " basic test for z commands that scroll the window |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
511 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
512 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
513 norm! >> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
514 " Test for z<cr> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
515 exe "norm! z\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
516 call assert_equal(' 100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
517 call assert_equal(100, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
518 call assert_equal([0, 100, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
519 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
520 " Test for zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
521 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
522 norm! >>0zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
523 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
524 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
525 call assert_equal([0, 21, 1, 0, 8], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
526 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
527 " Test for zb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
528 30 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
529 norm! >>$ztzb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
530 call assert_equal(' 30', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
531 call assert_equal(30, winsaveview()['topline']+winheight(0)-1) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
532 call assert_equal([0, 30, 3, 0, 2147483647], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
533 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
534 " Test for z- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
535 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
536 30 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
537 norm! 0z- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
538 call assert_equal(' 30', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
539 call assert_equal(30, winsaveview()['topline']+winheight(0)-1) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
540 call assert_equal([0, 30, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
541 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
542 " Test for z{height}<cr> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
543 call assert_equal(10, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
544 exe "norm! z12\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
545 call assert_equal(12, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
546 exe "norm! z10\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
547 call assert_equal(10, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
548 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
549 " Test for z. |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
550 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
551 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
552 norm! 0z. |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
553 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
554 call assert_equal(17, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
555 call assert_equal([0, 21, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
556 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
557 " Test for zz |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
558 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
559 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
560 norm! 0zz |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
561 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
562 call assert_equal(17, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
563 call assert_equal([0, 21, 1, 0, 8], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
564 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
565 " Test for z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
566 11 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
567 norm! zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
568 norm! z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
569 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
570 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
571 call assert_equal([0, 21, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
572 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
573 " Test for [count]z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
574 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
575 norm! 21z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
576 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
577 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
578 call assert_equal([0, 21, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
579 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
580 " Test for z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
581 norm! 22z+0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
582 norm! z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
583 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
584 call assert_equal(12, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
585 call assert_equal([0, 21, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
586 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
587 " Test for [count]z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
588 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
589 norm! 30z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
590 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
591 call assert_equal(12, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
592 call assert_equal([0, 21, 2, 0, 9], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
593 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
594 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
595 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
596 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
597 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
598 func Test_normal16_z_scroll_hor() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
599 " basic test for z commands that scroll the window |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
600 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
601 15vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
602 set nowrap listchars= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
603 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
604 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
605 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
606 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
607 1d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
608 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
609 " Test for zl and zh with a count |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
610 norm! 0z10l |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
611 call assert_equal([11, 1], [col('.'), wincol()]) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
612 norm! z4h |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
613 call assert_equal([11, 5], [col('.'), wincol()]) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
614 normal! 2gg |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
615 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
616 " Test for zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
617 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
618 norm! 5zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
619 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
620 call assert_equal(6, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
621 call assert_equal(5, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
622 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
623 call assert_equal('f', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
624 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
625 " Test for zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
626 norm! 2zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
627 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
628 call assert_equal(6, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
629 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
630 call assert_equal('f', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
631 call assert_equal(3, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
632 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
633 " Test for zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
634 norm! zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
635 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
636 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
637 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
638 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
639 norm! 2zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
640 call assert_equal(25, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
641 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
642 call assert_equal('y', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
643 call assert_equal(24, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
644 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
645 " Test for zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
646 norm! 2zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
647 call assert_equal(25, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
648 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
649 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
650 call assert_equal('y', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
651 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
652 " Test for zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
653 norm! $zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
654 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
655 call assert_equal(25, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
656 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
657 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
658 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
659 " Test for ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
660 norm! ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
661 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
662 call assert_equal(11, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
663 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
664 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
665 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
666 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
667 set wrap listchars=eol:$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
668 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
669 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
670 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
671 func Test_normal17_z_scroll_hor2() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
672 " basic test for z commands that scroll the window |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
673 " using 'sidescrolloff' setting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
674 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
675 20vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
676 set nowrap listchars= sidescrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
677 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
678 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
679 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
680 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
681 1d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
682 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
683 " Test for zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
684 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
685 norm! 5zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
686 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
687 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
688 call assert_equal(5, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
689 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
690 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
691 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
692 " Test for zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
693 norm! 2zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
694 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
695 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
696 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
697 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
698 call assert_equal(3, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
699 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
700 " Test for zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
701 norm! 0zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
702 call assert_equal(16, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
703 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
704 call assert_equal('p', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
705 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
706 norm! 2zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
707 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
708 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
709 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
710 call assert_equal(15, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
711 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
712 " Test for zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
713 norm! 2zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
714 call assert_equal(15, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
715 call assert_equal(0, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
716 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
717 call assert_equal('o', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
718 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
719 " Test for zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
720 norm! $zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
721 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
722 call assert_equal(20, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
723 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
724 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
725 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
726 " Test for ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
727 norm! ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
728 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
729 call assert_equal(11, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
730 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
731 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
732 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
733 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
734 set wrap listchars=eol:$ sidescrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
735 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
736 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
737 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
738 " Test for H, M and L commands with folds |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
739 func Test_scroll_cmds() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
740 15new |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
741 call setline(1, range(1, 100)) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
742 exe "normal! 30ggz\<CR>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
743 set foldenable |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
744 33,36fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
745 40,43fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
746 46,49fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
747 let h = winheight(0) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
748 " Top of the screen = 30 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
749 " Folded lines = 9 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
750 " Bottom of the screen = 30 + h + 9 - 1 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
751 normal! 4L |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
752 call assert_equal(35 + h, line('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
753 normal! 4H |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
754 call assert_equal(33, line('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
755 set foldenable& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
756 close! |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
757 endfunc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
758 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
759 func Test_normal18_z_fold() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
760 " basic tests for foldopen/folddelete |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
761 if !has("folding") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
762 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
763 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
764 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
765 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
766 setl foldenable fdm=marker foldlevel=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
767 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
768 call assert_beeps('normal! zj') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
769 call assert_beeps('normal! zk') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
770 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
771 " Test for zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
772 " First fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
773 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
774 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
775 call assert_equal(['50/*{{{*/', '51', '52', '53/*}}}*/'], getline(50,53)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
776 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
777 " Test for zd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
778 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
779 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
780 call assert_equal(2, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
781 norm! kzd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
782 call assert_equal(['50', '51/*{{{*/', '52/*}}}*/', '53'], getline(50,53)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
783 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
784 call assert_equal(1, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
785 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
786 " Test for zD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
787 " also deletes partially selected folds recursively |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
788 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
789 norm! zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
790 call assert_equal(2, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
791 norm! kV2jzD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
792 call assert_equal(['50', '51', '52', '53'], getline(50,53)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
793 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
794 " Test for zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
795 85 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
796 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
797 86 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
798 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
799 90 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
800 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
801 call assert_equal(['85/*{{{*/', '86/*{{{*/', '87/*}}}*/', '88/*}}}*/', '89', '90/*{{{*/', '91', '92', '93/*}}}*/'], getline(85,93)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
802 norm! zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
803 call assert_equal(['85', '86', '87', '88', '89', '90', '91', '92', '93'], getline(85,93)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
804 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
805 " Test for zn |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
806 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
807 set foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
808 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
809 norm! zn |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
810 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
811 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
812 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
813 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
814 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
815 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
816 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
817 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
818 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
819 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
820 " Test for zN |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
821 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
822 norm! zN |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
823 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
824 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
825 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
826 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
827 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
828 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
829 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
830 " Test for zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
831 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
832 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
833 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
834 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
835 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
836 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
837 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
838 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
839 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
840 " Test for za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
841 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
842 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
843 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
844 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
845 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
846 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
847 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
848 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
849 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
850 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
851 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
852 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
853 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
854 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
855 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
856 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
857 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
858 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
859 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
860 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
861 norm! 5zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
862 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
863 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
864 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
865 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
866 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
867 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
868 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
869 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
870 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
871 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
872 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
873 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
874 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
875 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
876 " close fold and set foldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
877 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
878 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
879 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
880 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
881 " have to use {count}za to open all folds and make the cursor visible |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
882 norm! 2za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
883 norm! 2k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
884 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
885 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
886 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
887 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
888 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
889 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
890 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
891 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
892 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
893 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
894 " Test for zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
895 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
896 set foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
897 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
898 norm! zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
899 norm! 2k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
900 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
901 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
902 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
903 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
904 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
905 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
906 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
907 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
908 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
909 |
11327
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
910 " zA on a opened fold when foldenable is not set |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
911 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
912 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
913 norm! zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
914 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
915 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
916 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
917 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
918 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
919 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
920 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
921 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
922 " Test for zc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
923 norm! zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
924 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
925 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
926 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
927 norm! 5zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
928 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
929 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
930 " There most likely is a bug somewhere: |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
931 " https://groups.google.com/d/msg/vim_dev/v2EkfJ_KQjI/u-Cvv94uCAAJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
932 " TODO: Should this only close the inner most fold or both folds? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
933 norm! zc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
934 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
935 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
936 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
937 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
938 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
939 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
940 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
941 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
942 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
943 norm! Vjzc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
944 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
945 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
946 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
947 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
948 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
949 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
950 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
951 " Test for zC |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
952 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
953 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
954 norm! zCk |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
955 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
956 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
957 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
958 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
959 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
960 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
961 " Test for zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
962 " 1) close folds at line 49-54 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
963 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
964 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
965 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
966 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
967 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
968 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
969 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
970 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
971 |
11327
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
972 " 2) do not close fold under cursor |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
973 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
974 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
975 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
976 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
977 norm! 3k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
978 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
979 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
980 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
981 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
982 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
983 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
984 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
985 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
986 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
987 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
988 call assert_equal('53', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
989 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
990 call assert_equal('54/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
991 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
992 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
993 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
994 " 3) close one level of folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
995 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
996 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
997 set foldlevel=1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
998 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
999 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1000 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1001 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1002 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1003 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1004 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1005 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1006 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1007 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1008 call assert_equal('53', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1009 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1010 call assert_equal('54/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1011 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1012 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1013 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1014 " Test for zX |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1015 " Close all folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1016 set foldlevel=0 nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1017 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1018 norm! zX |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1019 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1020 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1021 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1022 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1023 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1024 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1025 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1026 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1027 " Test for zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1028 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1029 set nofoldenable foldlevel=2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1030 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1031 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1032 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1033 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1034 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1035 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1036 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1037 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1038 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1039 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1040 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1041 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1042 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1043 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1044 " Test for zM |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1045 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1046 set nofoldenable foldlevel=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1047 norm! zM |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1048 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1049 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1050 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1051 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1052 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1053 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1054 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1055 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1056 " Test for zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1057 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1058 set nofoldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1059 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1060 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1061 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1062 set foldlevel=0 foldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1063 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1064 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1065 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1066 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1067 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1068 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1069 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1070 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1071 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1072 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1073 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1074 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1075 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1076 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1077 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1078 " Test for zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1079 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1080 set nofoldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1081 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1082 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1083 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1084 set foldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1085 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1086 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1087 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1088 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1089 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1090 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1091 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1092 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1093 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1094 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1095 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1096 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1097 call append(50, ['a /*{{{*/', 'b /*}}}*/']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1098 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1099 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1100 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1101 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1102 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1103 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1104 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1105 call assert_equal('a /*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1106 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1107 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1108 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1109 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1110 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1111 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1112 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1113 call assert_equal(3, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1114 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1115 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1116 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1117 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1118 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1119 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1120 call assert_equal('a /*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1121 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1122 call assert_equal('b /*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1123 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1124 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1125 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1126 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1127 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1128 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1129 setl nofoldenable fdm=marker foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1130 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1131 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1132 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1133 func Test_normal20_exmode() |
10092
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1134 if !has("unix") |
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1135 " Reading from redirected file doesn't work on MS-Windows |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1136 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1137 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1138 call writefile(['1a', 'foo', 'bar', '.', 'w! Xfile2', 'q!'], 'Xscript') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1139 call writefile(['1', '2'], 'Xfile') |
17698
131f1d8c5860
patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath
Bram Moolenaar <Bram@vim.org>
parents:
17682
diff
changeset
|
1140 call system(GetVimCommand() .. ' -e -s < Xscript Xfile') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1141 let a=readfile('Xfile2') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1142 call assert_equal(['1', 'foo', 'bar', '2'], a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1143 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1144 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1145 for file in ['Xfile', 'Xfile2', 'Xscript'] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1146 call delete(file) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1147 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1148 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1149 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1150 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1151 func Test_normal21_nv_hat() |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1152 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1153 " Edit a fresh file and wipe the buffer list so that there is no alternate |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1154 " file present. Next, check for the expected command failures. |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1155 edit Xfoo | %bw |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1156 call assert_fails(':buffer #', 'E86') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1157 call assert_fails(':execute "normal! \<C-^>"', 'E23') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1158 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1159 " Test for the expected behavior when switching between two named buffers. |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1160 edit Xfoo | edit Xbar |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1161 call feedkeys("\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1162 call assert_equal('Xfoo', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1163 call feedkeys("\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1164 call assert_equal('Xbar', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1165 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1166 " Test for the expected behavior when only one buffer is named. |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1167 enew | let l:nr = bufnr('%') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1168 call feedkeys("\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1169 call assert_equal('Xbar', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1170 call feedkeys("\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1171 call assert_equal('', bufname('%')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1172 call assert_equal(l:nr, bufnr('%')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1173 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1174 " Test that no action is taken by "<C-^>" when an operator is pending. |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1175 edit Xfoo |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1176 call feedkeys("ci\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1177 call assert_equal('Xfoo', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1178 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1179 %bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1180 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1181 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1182 func Test_normal22_zet() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1183 " Test for ZZ |
10092
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1184 " let shell = &shell |
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1185 " let &shell = 'sh' |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1186 call writefile(['1', '2'], 'Xfile') |
17698
131f1d8c5860
patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath
Bram Moolenaar <Bram@vim.org>
parents:
17682
diff
changeset
|
1187 let args = ' -N -i NONE --noplugins -X --not-a-term' |
131f1d8c5860
patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath
Bram Moolenaar <Bram@vim.org>
parents:
17682
diff
changeset
|
1188 call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xfile') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1189 let a = readfile('Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1190 call assert_equal([], a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1191 " Test for ZQ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1192 call writefile(['1', '2'], 'Xfile') |
17698
131f1d8c5860
patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath
Bram Moolenaar <Bram@vim.org>
parents:
17682
diff
changeset
|
1193 call system(GetVimCommand() . args . ' -c "%d" -c ":norm! ZQ" Xfile') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1194 let a = readfile('Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1195 call assert_equal(['1', '2'], a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1196 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1197 " Unsupported Z command |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1198 call assert_beeps('normal! ZW') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1199 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1200 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1201 for file in ['Xfile'] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1202 call delete(file) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1203 endfor |
10092
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1204 " let &shell = shell |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1205 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1206 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1207 func Test_normal23_K() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1208 " Test for K command |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1209 new |
10330
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1210 call append(0, ['version8.txt', 'man', 'aa%bb', 'cc|dd']) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1211 let k = &keywordprg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1212 set keywordprg=:help |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1213 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1214 norm! VK |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1215 call assert_equal('version8.txt', fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1216 call assert_equal('help', &ft) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1217 call assert_match('\*version8.txt\*', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1218 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1219 norm! 0K |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1220 call assert_equal('version8.txt', fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1221 call assert_equal('help', &ft) |
13963 | 1222 call assert_match('\*version8\.\d\*', getline('.')) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1223 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1224 |
10330
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1225 set keywordprg=:new |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1226 set iskeyword+=% |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1227 set iskeyword+=\| |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1228 2 |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1229 norm! K |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1230 call assert_equal('man', fnamemodify(bufname('%'), ':t')) |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1231 bwipe! |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1232 3 |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1233 norm! K |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1234 call assert_equal('aa%bb', fnamemodify(bufname('%'), ':t')) |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1235 bwipe! |
10338
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1236 if !has('win32') |
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1237 4 |
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1238 norm! K |
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1239 call assert_equal('cc|dd', fnamemodify(bufname('%'), ':t')) |
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1240 bwipe! |
e8a6a3bbd212
commit https://github.com/vim/vim/commit/eb828d01d9c91791fa1fe217ba651cdc25746d1b
Christian Brabandt <cb@256bit.org>
parents:
10330
diff
changeset
|
1241 endif |
10330
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1242 set iskeyword-=% |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1243 set iskeyword-=\| |
71ca6a16e818
commit https://github.com/vim/vim/commit/426f3754223c8ff8a1bc51d6ba1eba11e8982ebc
Christian Brabandt <cb@256bit.org>
parents:
10166
diff
changeset
|
1244 |
10092
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1245 " Only expect "man" to work on Unix |
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
1246 if !has("unix") |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1247 let &keywordprg = k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1248 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1249 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1250 endif |
16419
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1251 |
18736
97d534e17874
patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
18730
diff
changeset
|
1252 let not_gnu_man = has('mac') || has('bsd') |
97d534e17874
patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
18730
diff
changeset
|
1253 if not_gnu_man |
18730
2faf6c331cb8
patch 8.1.2355: test with "man" fails on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
18475
diff
changeset
|
1254 " In MacOS and BSD, the option for specifying a pager is different |
16419
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1255 set keywordprg=man\ -P\ cat |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1256 else |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1257 set keywordprg=man\ --pager=cat |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1258 endif |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1259 " Test for using man |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1260 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1261 let a = execute('unsilent norm! K') |
18736
97d534e17874
patch 8.1.2358: tests fail on Cirrus CI for FreeBSD
Bram Moolenaar <Bram@vim.org>
parents:
18730
diff
changeset
|
1262 if not_gnu_man |
16419
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1263 call assert_match("man -P cat 'man'", a) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1264 else |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1265 call assert_match("man --pager=cat 'man'", a) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
1266 endif |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1267 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1268 " Error cases |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1269 call setline(1, '#$#') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1270 call assert_fails('normal! ggK', 'E349:') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1271 call setline(1, '---') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1272 call assert_fails('normal! ggv2lK', 'E349:') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1273 call setline(1, ['abc', 'xyz']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1274 call assert_fails("normal! gg2lv2h\<C-]>", 'E426:') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1275 call assert_beeps("normal! ggVjK") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1276 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1277 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1278 let &keywordprg = k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1279 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1280 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1281 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1282 func Test_normal24_rot13() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1283 " Testing for g?? g?g? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1284 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1285 call append(0, 'abcdefghijklmnopqrstuvwxyzäüö') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1286 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1287 norm! g?? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1288 call assert_equal('nopqrstuvwxyzabcdefghijklmäüö', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1289 norm! g?g? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1290 call assert_equal('abcdefghijklmnopqrstuvwxyzäüö', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1291 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1292 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1293 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1294 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1295 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1296 func Test_normal25_tag() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18736
diff
changeset
|
1297 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18736
diff
changeset
|
1298 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1299 " Testing for CTRL-] g CTRL-] g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1300 " CTRL-W g] CTRL-W CTRL-] CTRL-W g CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1301 h |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1302 " Test for CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1303 call search('\<x\>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1304 exe "norm! \<c-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1305 call assert_equal("change.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1306 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1307 call assert_equal("*x*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1308 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1309 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1310 " Test for g_CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1311 call search('\<v_u\>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1312 exe "norm! g\<c-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1313 call assert_equal("change.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1314 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1315 call assert_equal("*v_u*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1316 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1317 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1318 " Test for g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1319 call search('\<i_<Esc>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1320 let a = execute(":norm! g]") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1321 call assert_match('i_<Esc>.*insert.txt', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1322 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1323 if !empty(exepath('cscope')) && has('cscope') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1324 " setting cscopetag changes how g] works |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1325 set cst |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1326 exe "norm! g]" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1327 call assert_equal("insert.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1328 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1329 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1330 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1331 " Test for CTRL-W g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1332 exe "norm! \<C-W>g]" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1333 call assert_equal("insert.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1334 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1335 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1336 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1337 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1338 set nocst |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1339 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1340 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1341 " Test for CTRL-W g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1342 let a = execute("norm! \<C-W>g]") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1343 call assert_match('i_<Esc>.*insert.txt', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1344 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1345 " Test for CTRL-W CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1346 exe "norm! \<C-W>\<C-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1347 call assert_equal("insert.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1348 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1349 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1350 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1351 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1352 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1353 " Test for CTRL-W g CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1354 exe "norm! \<C-W>g\<C-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1355 call assert_equal("insert.txt", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1356 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1357 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1358 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1359 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1360 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1361 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1362 helpclose |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1363 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1364 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1365 func Test_normal26_put() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1366 " Test for ]p ]P [p and [P |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1367 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1368 call append(0, ['while read LINE', 'do', ' ((count++))', ' if [ $? -ne 0 ]; then', " echo 'Error writing file'", ' fi', 'done']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1369 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1370 /Error/y a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1371 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1372 norm! "a]pj"a[p |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1373 call assert_equal(['do', "echo 'Error writing file'", " echo 'Error writing file'", ' ((count++))'], getline(2,5)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1374 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1375 /^\s\{4}/ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1376 exe "norm! \"a]P3Eldt'" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1377 exe "norm! j\"a[P2Eldt'" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1378 call assert_equal([' if [ $? -ne 0 ]; then', " echo 'Error writing'", " echo 'Error'", " echo 'Error writing file'", ' fi'], getline(6,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1379 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1380 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1381 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1382 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1383 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1384 func Test_normal27_bracket() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1385 " Test for [' [` ]' ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1386 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1387 1,21s/.\+/ & b/ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1388 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1389 norm! $ma |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1390 5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1391 norm! $mb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1392 10 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1393 norm! $mc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1394 15 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1395 norm! $md |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1396 20 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1397 norm! $me |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1398 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1399 " Test for [' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1400 9 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1401 norm! 2[' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1402 call assert_equal(' 1 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1403 call assert_equal(1, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1404 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1405 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1406 " Test for ]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1407 norm! ]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1408 call assert_equal(' 5 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1409 call assert_equal(5, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1410 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1411 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1412 " No mark after line 21, cursor moves to first non blank on current line |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1413 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1414 norm! $]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1415 call assert_equal(' 21 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1416 call assert_equal(21, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1417 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1418 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1419 " Test for [` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1420 norm! 2[` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1421 call assert_equal(' 15 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1422 call assert_equal(15, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1423 call assert_equal(8, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1424 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1425 " Test for ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1426 norm! ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1427 call assert_equal(' 20 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1428 call assert_equal(20, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1429 call assert_equal(8, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1430 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1431 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1432 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1433 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1434 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1435 " Test for ( and ) sentence movements |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1436 func Test_normal28_parenthesis() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1437 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1438 call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1439 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1440 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1441 norm! d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1442 call assert_equal(['This is a test. With some sentences!', '', 'Even with a question? And one more. ', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1443 norm! 2d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1444 call assert_equal(['This is a test. With some sentences!', '', ' ', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1445 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1446 norm! 0d) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1447 call assert_equal(['With some sentences!', '', ' ', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1448 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1449 call append('$', ['This is a long sentence', '', 'spanning', 'over several lines. ']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1450 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1451 norm! $d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1452 call assert_equal(['With some sentences!', '', ' ', '', 'This is a long sentence', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1453 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1454 " It is an error if a next sentence is not found |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1455 %d |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1456 call setline(1, '.SH') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1457 call assert_beeps('normal )') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1458 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1459 " Jumping to a fold should open the fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1460 call setline(1, ['', '', 'one', 'two', 'three']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1461 set foldenable |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1462 2,$fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1463 call feedkeys(')', 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1464 call assert_equal(3, line('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1465 call assert_equal(1, foldlevel('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1466 call assert_equal(-1, foldclosed('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1467 set foldenable& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1468 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1469 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1470 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1471 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1472 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1473 " Test for { and } paragraph movements |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1474 func Test_normal29_brace() |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1475 let text =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1476 A paragraph begins after each empty line, and also at each of a set of |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1477 paragraph macros, specified by the pairs of characters in the 'paragraphs' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1478 option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1479 the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1480 the first column). A section boundary is also a paragraph boundary. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1481 Note that a blank line (only containing white space) is NOT a paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1482 boundary. |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1483 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1484 |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1485 Also note that this does not include a '{' or '}' in the first column. When |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1486 the '{' flag is in 'cpoptions' then '{' in the first column is used as a |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1487 paragraph boundary |posix|. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1488 { |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1489 This is no paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1490 unless the '{' is set |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1491 in 'cpoptions' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1492 } |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1493 .IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1494 The nroff macros IP separates a paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1495 That means, it must be a '.' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1496 followed by IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1497 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1498 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1499 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1500 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1501 a character like this: |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1502 .NH |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1503 End of text here |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1504 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1505 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1506 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1507 call append(0, text) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1508 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1509 norm! 0d2} |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1510 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1511 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1512 .IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1513 The nroff macros IP separates a paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1514 That means, it must be a '.' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1515 followed by IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1516 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1517 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1518 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1519 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1520 a character like this: |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1521 .NH |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1522 End of text here |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1523 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1524 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1525 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1526 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1527 norm! 0d} |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1528 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1529 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1530 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1531 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1532 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1533 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1534 a character like this: |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1535 .NH |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1536 End of text here |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1537 |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1538 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1539 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1540 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1541 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1542 norm! d{ |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1543 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1544 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1545 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1546 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1547 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1548 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1549 a character like this: |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1550 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1551 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1552 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1553 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1554 norm! d{ |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1555 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1556 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1557 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1558 more characters follow. |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1559 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1560 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1561 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1562 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1563 " Test with { in cpooptions |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1564 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1565 call append(0, text) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1566 set cpo+={ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1567 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1568 norm! 0d2} |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1569 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1570 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1571 { |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1572 This is no paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1573 unless the '{' is set |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1574 in 'cpoptions' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1575 } |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1576 .IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1577 The nroff macros IP separates a paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1578 That means, it must be a '.' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1579 followed by IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1580 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1581 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1582 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1583 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1584 a character like this: |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1585 .NH |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1586 End of text here |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1587 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1588 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1589 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1590 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1591 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1592 norm! d} |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1593 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1594 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1595 { |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1596 This is no paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1597 unless the '{' is set |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1598 in 'cpoptions' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1599 } |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1600 .IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1601 The nroff macros IP separates a paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1602 That means, it must be a '.' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1603 followed by IP |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1604 .LPIt does not matter, if afterwards some |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1605 more characters follow. |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1606 .SHAlso section boundaries from the nroff |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1607 macros terminate a paragraph. That means |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1608 a character like this: |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1609 .NH |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1610 End of text here |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1611 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1612 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1613 call assert_equal(expected, getline(1, '$')) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1614 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1615 norm! gg} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1616 norm! d5} |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1617 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1618 let expected =<< trim [DATA] |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1619 { |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1620 This is no paragraph |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1621 unless the '{' is set |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1622 in 'cpoptions' |
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
1623 } |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1624 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1625 [DATA] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16419
diff
changeset
|
1626 call assert_equal(expected, getline(1, '$')) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1627 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1628 " Jumping to a fold should open the fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1629 %d |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1630 call setline(1, ['', 'one', 'two', '']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1631 set foldenable |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1632 2,$fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1633 call feedkeys('}', 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1634 call assert_equal(4, line('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1635 call assert_equal(1, foldlevel('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1636 call assert_equal(-1, foldclosed('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1637 set foldenable& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1638 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1639 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1640 set cpo-={ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1641 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1642 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1643 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1644 " Test for ~ command |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1645 func Test_normal30_changecase() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1646 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1647 call append(0, 'This is a simple test: äüöß') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1648 norm! 1ggVu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1649 call assert_equal('this is a simple test: äüöß', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1650 norm! VU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1651 call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1652 norm! guu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1653 call assert_equal('this is a simple test: äüöss', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1654 norm! gUgU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1655 call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1656 norm! gugu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1657 call assert_equal('this is a simple test: äüöss', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1658 norm! gUU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1659 call assert_equal('THIS IS A SIMPLE TEST: ÄÜÖSS', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1660 norm! 010~ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1661 call assert_equal('this is a SIMPLE TEST: ÄÜÖSS', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1662 norm! V~ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1663 call assert_equal('THIS IS A simple test: äüöss', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1664 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1665 " Test for changing case across lines using 'whichwrap' |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1666 call setline(1, ['aaaaaa', 'aaaaaa']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1667 normal! gg10~ |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1668 call assert_equal(['AAAAAA', 'aaaaaa'], getline(1, 2)) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1669 set whichwrap+=~ |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1670 normal! gg10~ |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1671 call assert_equal(['aaaaaa', 'AAAAaa'], getline(1, 2)) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1672 set whichwrap& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1673 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1674 " clean up |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1675 bw! |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1676 endfunc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1677 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1678 " Turkish ASCII turns to multi-byte. On some systems Turkish locale |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1679 " is available but toupper()/tolower() don't do the right thing. |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1680 func Test_normal_changecase_turkish() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1681 new |
14669
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1682 try |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1683 lang tr_TR.UTF-8 |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1684 set casemap= |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1685 let iupper = toupper('i') |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1686 if iupper == "\u0130" |
11335
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1687 call setline(1, 'iI') |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1688 1normal gUU |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1689 call assert_equal("\u0130I", getline(1)) |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1690 call assert_equal("\u0130I", toupper("iI")) |
11333
fef09eb74832
patch 8.0.0552: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11327
diff
changeset
|
1691 |
11335
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1692 call setline(1, 'iI') |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1693 1normal guu |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1694 call assert_equal("i\u0131", getline(1)) |
bc8e3fd275be
patch 8.0.0553: toupper/tolower test fails on Mac
Christian Brabandt <cb@256bit.org>
parents:
11333
diff
changeset
|
1695 call assert_equal("i\u0131", tolower("iI")) |
14669
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1696 elseif iupper == "I" |
11337
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1697 call setline(1, 'iI') |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1698 1normal gUU |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1699 call assert_equal("II", getline(1)) |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1700 call assert_equal("II", toupper("iI")) |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1701 |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1702 call setline(1, 'iI') |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1703 1normal guu |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1704 call assert_equal("ii", getline(1)) |
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1705 call assert_equal("ii", tolower("iI")) |
14669
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1706 else |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1707 call assert_true(false, "expected toupper('i') to be either 'I' or '\u0130'") |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1708 endif |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1709 set casemap& |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1710 call setline(1, 'iI') |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1711 1normal gUU |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1712 call assert_equal("II", getline(1)) |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1713 call assert_equal("II", toupper("iI")) |
11337
f0fbebf19b80
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Christian Brabandt <cb@256bit.org>
parents:
11335
diff
changeset
|
1714 |
14669
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1715 call setline(1, 'iI') |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1716 1normal guu |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1717 call assert_equal("ii", getline(1)) |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1718 call assert_equal("ii", tolower("iI")) |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1719 |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1720 lang en_US.UTF-8 |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1721 catch /E197:/ |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1722 " can't use Turkish locale |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1723 throw 'Skipped: Turkish locale not available' |
63d5ae57a663
patch 8.1.0347: some tests fail on Solaris
Christian Brabandt <cb@256bit.org>
parents:
14627
diff
changeset
|
1724 endtry |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1725 close! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1726 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1727 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1728 " Test for r (replace) command |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1729 func Test_normal31_r_cmd() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1730 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1731 call append(0, 'This is a simple test: abcd') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1732 exe "norm! 1gg$r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1733 call assert_equal(['This is a simple test: abc', '', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1734 exe "norm! 1gg2wlr\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1735 call assert_equal(['This is a', 'simple test: abc', '', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1736 exe "norm! 2gg0W5r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1737 call assert_equal(['This is a', 'simple ', ' abc', '', ''], getline('1', '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1738 set autoindent |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1739 call setline(2, ['simple test: abc', '']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1740 exe "norm! 2gg0W5r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1741 call assert_equal(['This is a', 'simple ', 'abc', '', '', ''], getline('1', '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1742 exe "norm! 1ggVr\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1743 call assert_equal('^M^M^M^M^M^M^M^M^M', strtrans(getline(1))) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1744 call setline(1, 'This is a') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1745 exe "norm! 1gg05rf" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1746 call assert_equal('fffffis a', getline(1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1747 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1748 " When replacing characters, copy characters from above and below lines |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1749 " using CTRL-Y and CTRL-E. |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1750 " Different code paths are used for utf-8 and latin1 encodings |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1751 set showmatch |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1752 for enc in ['latin1', 'utf-8'] |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1753 enew! |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1754 let &encoding = enc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1755 call setline(1, [' {a}', 'xxxxxxxxxx', ' [b]']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1756 exe "norm! 2gg5r\<C-Y>l5r\<C-E>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1757 call assert_equal(' {a}x [b]x', getline(2)) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1758 endfor |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1759 set showmatch& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1760 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1761 " r command should fail in operator pending mode |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1762 call assert_beeps('normal! cr') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1763 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1764 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1765 set noautoindent |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1766 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1767 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1768 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1769 " Test for g*, g# |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1770 func Test_normal32_g_cmd1() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1771 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1772 call append(0, ['abc.x_foo', 'x_foobar.abc']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1773 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1774 norm! $g* |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1775 call assert_equal('x_foo', @/) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1776 call assert_equal('x_foobar.abc', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1777 norm! $g# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1778 call assert_equal('abc', @/) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1779 call assert_equal('abc.x_foo', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1780 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1781 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1782 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1783 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1784 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1785 " Test for g`, g;, g,, g&, gv, gk, gj, gJ, g0, g^, g_, gm, g$, gM, g CTRL-G, |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1786 " gi and gI commands |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1787 func Test_normal33_g_cmd2() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1788 if !has("jumplist") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1789 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1790 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1791 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1792 " Test for g` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1793 clearjumps |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1794 norm! ma10j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1795 let a=execute(':jumps') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1796 " empty jumplist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1797 call assert_equal('>', a[-1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1798 norm! g`a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1799 call assert_equal('>', a[-1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1800 call assert_equal(1, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1801 call assert_equal('1', getline('.')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1802 call cursor(10, 1) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1803 norm! g'a |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1804 call assert_equal('>', a[-1:]) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1805 call assert_equal(1, line('.')) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1806 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1807 " Test for g; and g, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1808 norm! g; |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1809 " there is only one change in the changelist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1810 " currently, when we setup the window |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1811 call assert_equal(2, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1812 call assert_fails(':norm! g;', 'E662') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1813 call assert_fails(':norm! g,', 'E663') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1814 let &ul=&ul |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1815 call append('$', ['a', 'b', 'c', 'd']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1816 let &ul=&ul |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1817 call append('$', ['Z', 'Y', 'X', 'W']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1818 let a = execute(':changes') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1819 call assert_match('2\s\+0\s\+2', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1820 call assert_match('101\s\+0\s\+a', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1821 call assert_match('105\s\+0\s\+Z', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1822 norm! 3g; |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1823 call assert_equal(2, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1824 norm! 2g, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1825 call assert_equal(105, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1826 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1827 " Test for g& - global substitute |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1828 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1829 call setline(1, range(1,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1830 call append('$', ['a', 'b', 'c', 'd']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1831 $s/\w/&&/g |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1832 exe "norm! /[1-8]\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1833 norm! g& |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1834 call assert_equal(['11', '22', '33', '44', '55', '66', '77', '88', '9', '110', 'a', 'b', 'c', 'dd'], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1835 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1836 " Jumping to a fold using gg should open the fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1837 set foldenable |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1838 set foldopen+=jump |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1839 5,8fold |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1840 call feedkeys('6gg', 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1841 call assert_equal(1, foldlevel('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1842 call assert_equal(-1, foldclosed('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1843 set foldopen-=jump |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1844 set foldenable& |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1845 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1846 " Test for gv |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1847 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1848 call append('$', repeat(['abcdefgh'], 8)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1849 exe "norm! 2gg02l\<c-v>2j2ly" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1850 call assert_equal(['cde', 'cde', 'cde'], getreg(0, 1, 1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1851 " in visual mode, gv swaps current and last selected region |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1852 exe "norm! G0\<c-v>4k4lgvd" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1853 call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'abcdefgh', 'abcdefgh', 'abcdefgh', 'abcdefgh', 'abcdefgh'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1854 exe "norm! G0\<c-v>4k4ly" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1855 exe "norm! gvood" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1856 call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1857 " gv cannot be used in operator pending mode |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1858 call assert_beeps('normal! cgv') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1859 " gv should beep without a previously selected visual area |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1860 new |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1861 call assert_beeps('normal! gv') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1862 close |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1863 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1864 " Test for gk/gj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1865 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1866 15vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1867 set wrap listchars= sbr= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1868 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1869 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
18475
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1870 let lineC='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1871 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1872 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1873 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1874 norm! 3gg0dgk |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1875 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1876 set nu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1877 norm! 3gg0gjdgj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1878 call assert_equal(['', 'abcdefghijklmno', '0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1879 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1880 " Test for gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1881 norm! 2gggJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1882 call assert_equal(['', 'abcdefghijklmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1883 call assert_equal(16, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1884 " shouldn't do anything |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1885 norm! 10gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1886 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1887 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1888 " Test for g0 g^ gm g$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1889 exe "norm! 2gg0gji " |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1890 call assert_equal(['', 'abcdefghijk lmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1891 norm! g0yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1892 call assert_equal(12, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1893 call assert_equal(' ', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1894 norm! g$yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1895 call assert_equal(22, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1896 call assert_equal('3', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1897 norm! gmyl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1898 call assert_equal(17, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1899 call assert_equal('n', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1900 norm! g^yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1901 call assert_equal(15, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1902 call assert_equal('l', getreg(0)) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1903 call assert_beeps('normal 5g$') |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1904 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1905 " Test for g_ |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1906 call assert_beeps('normal! 100g_') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1907 call setline(2, [' foo ', ' foobar ']) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1908 normal! 2ggg_ |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1909 call assert_equal(5, col('.')) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1910 normal! 2g_ |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1911 call assert_equal(8, col('.')) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1912 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1913 norm! 2ggdG |
18475
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1914 $put =lineC |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1915 |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1916 " Test for gM |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1917 norm! gMyl |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1918 call assert_equal(73, col('.')) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1919 call assert_equal('0', getreg(0)) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1920 " Test for 20gM |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1921 norm! 20gMyl |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1922 call assert_equal(29, col('.')) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1923 call assert_equal('S', getreg(0)) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1924 " Test for 60gM |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1925 norm! 60gMyl |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1926 call assert_equal(87, col('.')) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1927 call assert_equal('E', getreg(0)) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1928 |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1929 " Test for g Ctrl-G |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1930 set ff=unix |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1931 let a=execute(":norm! g\<c-g>") |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1932 call assert_match('Col 87 of 144; Line 2 of 2; Word 1 of 1; Byte 88 of 146', a) |
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1933 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1934 " Test for gI |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1935 norm! gIfoo |
18475
709c6b0dc78f
patch 8.1.2231: not easy to move to the middle of a text line
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
1936 call assert_equal(['', 'foo0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'], getline(1,'$')) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1937 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1938 " Test for gi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1939 wincmd c |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1940 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1941 set tw=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1942 call setline(1, ['foobar', 'new line']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1943 norm! A next word |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1944 $put ='third line' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1945 norm! gi another word |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1946 call assert_equal(['foobar next word another word', 'new line', 'third line'], getline(1,'$')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1947 call setline(1, 'foobar') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1948 normal! Ggifirst line |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1949 call assert_equal('foobarfirst line', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1950 " Test gi in 'virtualedit' mode with cursor after the end of the line |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1951 set virtualedit=all |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1952 call setline(1, 'foo') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1953 exe "normal! Abar\<Right>\<Right>\<Right>\<Right>" |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1954 call setline(1, 'foo') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1955 normal! Ggifirst line |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1956 call assert_equal('foo first line', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1957 set virtualedit& |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1958 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1959 " Test for aboring a g command using CTRL-\ CTRL-G |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1960 exe "normal! g\<C-\>\<C-G>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1961 call assert_equal('foo first line', getline('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1962 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1963 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1964 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
1965 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1966 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1967 " Test for g CTRL-G |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
1968 func Test_g_ctrl_g() |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1969 new |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1970 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1971 let a = execute(":norm! g\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1972 call assert_equal("\n--No lines in buffer--", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1973 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1974 " Test for CTRL-G (same as :file) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1975 let a = execute(":norm! \<c-g>") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1976 call assert_equal("\n\n\"[No Name]\" --No lines in buffer--", a) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1977 |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1978 call setline(1, ['first line', 'second line']) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1979 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1980 " Test g CTRL-g with dos, mac and unix file type. |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1981 norm! gojll |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1982 set ff=dos |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1983 let a = execute(":norm! g\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1984 call assert_equal("\nCol 3 of 11; Line 2 of 2; Word 3 of 4; Byte 15 of 25", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1985 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1986 set ff=mac |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1987 let a = execute(":norm! g\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1988 call assert_equal("\nCol 3 of 11; Line 2 of 2; Word 3 of 4; Byte 14 of 23", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1989 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1990 set ff=unix |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1991 let a = execute(":norm! g\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1992 call assert_equal("\nCol 3 of 11; Line 2 of 2; Word 3 of 4; Byte 14 of 23", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1993 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1994 " Test g CTRL-g in visual mode (v) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1995 let a = execute(":norm! gojllvlg\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1996 call assert_equal("\nSelected 1 of 2 Lines; 1 of 4 Words; 2 of 23 Bytes", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1997 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1998 " Test g CTRL-g in visual mode (CTRL-V) with end col > start col |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
1999 let a = execute(":norm! \<Esc>gojll\<C-V>kllg\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2000 call assert_equal("\nSelected 3 Cols; 2 of 2 Lines; 2 of 4 Words; 6 of 23 Bytes", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2001 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2002 " Test g_CTRL-g in visual mode (CTRL-V) with end col < start col |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2003 let a = execute(":norm! \<Esc>goll\<C-V>jhhg\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2004 call assert_equal("\nSelected 3 Cols; 2 of 2 Lines; 2 of 4 Words; 6 of 23 Bytes", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2005 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2006 " Test g CTRL-g in visual mode (CTRL-V) with end_vcol being MAXCOL |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2007 let a = execute(":norm! \<Esc>gojll\<C-V>k$g\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2008 call assert_equal("\nSelected 2 of 2 Lines; 4 of 4 Words; 17 of 23 Bytes", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2009 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2010 " There should be one byte less with noeol |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2011 set bin noeol |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2012 let a = execute(":norm! \<Esc>gog\<c-g>") |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2013 call assert_equal("\nCol 1 of 10; Line 1 of 2; Word 1 of 4; Char 1 of 23; Byte 1 of 22", a) |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2014 set bin & eol& |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2015 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2016 call setline(1, ['Français', '日本語']) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2017 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2018 let a = execute(":norm! \<Esc>gojlg\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2019 call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2020 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2021 let a = execute(":norm! \<Esc>gojvlg\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2022 call assert_equal("\nSelected 1 of 2 Lines; 1 of 2 Words; 2 of 13 Chars; 6 of 20 Bytes", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2023 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2024 let a = execute(":norm! \<Esc>goll\<c-v>jlg\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2025 call assert_equal("\nSelected 4 Cols; 2 of 2 Lines; 2 of 2 Words; 6 of 13 Chars; 11 of 20 Bytes", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2026 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2027 set fenc=utf8 bomb |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2028 let a = execute(":norm! \<Esc>gojlg\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2029 call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+3 for BOM)", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2030 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2031 set fenc=utf16 bomb |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2032 let a = execute(":norm! g\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2033 call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+2 for BOM)", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2034 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2035 set fenc=utf32 bomb |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2036 let a = execute(":norm! g\<c-g>") |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2037 call assert_equal("\nCol 4-3 of 9-6; Line 2 of 2; Word 2 of 2; Char 11 of 13; Byte 16 of 20(+4 for BOM)", a) |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2038 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2039 set fenc& bomb& |
14627
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2040 |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2041 set ff& |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2042 bwipe! |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2043 endfunc |
335f32c55ac3
patch 8.1.0327: the "g CTRL-G" command isn't tested much
Christian Brabandt <cb@256bit.org>
parents:
13963
diff
changeset
|
2044 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2045 " Test for g8 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2046 func Test_normal34_g_cmd3() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2047 new |
11327
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2048 let a=execute(':norm! 1G0g8') |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2049 call assert_equal("\nNUL", a) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2050 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2051 call setline(1, 'abcdefghijklmnopqrstuvwxyzäüö') |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2052 let a=execute(':norm! 1G$g8') |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2053 call assert_equal("\nc3 b6 ", a) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2054 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2055 call setline(1, "a\u0302") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2056 let a=execute(':norm! 1G0g8') |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2057 call assert_equal("\n61 + cc 82 ", a) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2058 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2059 " clean up |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2060 bw! |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2061 endfunc |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2062 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2063 " Test 8g8 which finds invalid utf8 at or after the cursor. |
11327
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2064 func Test_normal_8g8() |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2065 new |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2066 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2067 " With invalid byte. |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2068 call setline(1, "___\xff___") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2069 norm! 1G08g8g |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2070 call assert_equal([0, 1, 4, 0, 1], getcurpos()) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2071 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2072 " With invalid byte before the cursor. |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2073 call setline(1, "___\xff___") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2074 norm! 1G$h8g8g |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2075 call assert_equal([0, 1, 6, 0, 9], getcurpos()) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2076 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2077 " With truncated sequence. |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2078 call setline(1, "___\xE2\x82___") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2079 norm! 1G08g8g |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2080 call assert_equal([0, 1, 4, 0, 1], getcurpos()) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2081 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2082 " With overlong sequence. |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2083 call setline(1, "___\xF0\x82\x82\xAC___") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2084 norm! 1G08g8g |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2085 call assert_equal([0, 1, 4, 0, 1], getcurpos()) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2086 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2087 " With valid utf8. |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2088 call setline(1, "café") |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2089 norm! 1G08g8 |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2090 call assert_equal([0, 1, 1, 0, 1], getcurpos()) |
9e899514e929
patch 8.0.0549: no test for the 8g8 command
Christian Brabandt <cb@256bit.org>
parents:
11275
diff
changeset
|
2091 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2092 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2093 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2094 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2095 " Test for g< |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2096 func Test_normal35_g_cmd4() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2097 " Cannot capture its output, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2098 " probably a bug, therefore, test disabled: |
10124
f6942ed9e998
commit https://github.com/vim/vim/commit/31845093b7f1b33e0c7e9e592bef65528674a1f2
Christian Brabandt <cb@256bit.org>
parents:
10104
diff
changeset
|
2099 throw "Skipped: output of g< can't be tested currently" |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2100 echo "a\nb\nc\nd" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2101 let b=execute(':norm! g<') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2102 call assert_true(!empty(b), 'failed `execute(g<)`') |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2103 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2104 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2105 " Test for gp gP go |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2106 func Test_normal36_g_cmd5() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2107 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2108 call append(0, 'abcdefghijklmnopqrstuvwxyz') |
10092
d7846e9fbf65
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Christian Brabandt <cb@256bit.org>
parents:
10088
diff
changeset
|
2109 set ff=unix |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2110 " Test for gp gP |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2111 call append(1, range(1,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2112 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2113 norm! 1yy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2114 3 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2115 norm! gp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2116 call assert_equal([0, 5, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2117 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2118 norm! gP |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2119 call assert_equal([0, 14, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2120 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2121 " Test for go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2122 norm! 26go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2123 call assert_equal([0, 1, 26, 0, 26], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2124 norm! 27go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2125 call assert_equal([0, 1, 26, 0, 26], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2126 norm! 28go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2127 call assert_equal([0, 2, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2128 set ff=dos |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2129 norm! 29go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2130 call assert_equal([0, 2, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2131 set ff=unix |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2132 norm! gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2133 norm! 101go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2134 call assert_equal([0, 13, 26, 0, 26], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2135 norm! 103go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2136 call assert_equal([0, 14, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2137 " count > buffer content |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2138 norm! 120go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2139 call assert_equal([0, 14, 1, 0, 2147483647], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2140 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2141 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2142 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2143 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2144 " Test for gt and gT |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2145 func Test_normal37_g_cmd6() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2146 tabnew 1.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2147 tabnew 2.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2148 tabnew 3.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2149 norm! 1gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2150 call assert_equal(1, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2151 norm! 3gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2152 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2153 norm! 1gT |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2154 " count gT goes not to the absolute tabpagenumber |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2155 " but, but goes to the count previous tabpagenumber |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2156 call assert_equal(2, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2157 " wrap around |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2158 norm! 3gT |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2159 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2160 " gt does not wrap around |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2161 norm! 5gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2162 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2163 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2164 for i in range(3) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2165 tabclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2166 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2167 " clean up |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
2168 call assert_fails(':tabclose', 'E784:') |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2169 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2170 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2171 " Test for <Home> and <C-Home> key |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2172 func Test_normal38_nvhome() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2173 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2174 call setline(1, range(10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2175 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2176 setl et sw=2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2177 norm! V10>$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2178 " count is ignored |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2179 exe "norm! 10\<home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2180 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2181 exe "norm! \<home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2182 call assert_equal([0, 10, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2183 exe "norm! 5\<c-home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2184 call assert_equal([0, 5, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2185 exe "norm! \<c-home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2186 call assert_equal([0, 1, 1, 0, 1], getcurpos()) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2187 exe "norm! G\<c-kHome>" |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2188 call assert_equal([0, 1, 1, 0, 1], getcurpos()) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2189 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2190 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2191 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2192 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2193 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2194 " Test for <End> and <C-End> keys |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2195 func Test_normal_nvend() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2196 new |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2197 call setline(1, map(range(1, 10), '"line" .. v:val')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2198 exe "normal! \<End>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2199 call assert_equal(5, col('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2200 exe "normal! 4\<End>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2201 call assert_equal([4, 5], [line('.'), col('.')]) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2202 exe "normal! \<C-End>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2203 call assert_equal([10, 6], [line('.'), col('.')]) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2204 close! |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2205 endfunc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2206 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2207 " Test for cw cW ce |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2208 func Test_normal39_cw() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2209 " Test for cw and cW on whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2210 " and cpo+=w setting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2211 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2212 set tw=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2213 call append(0, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2214 norm! 1gg0elcwZZZ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2215 call assert_equal('hereZZZare some words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2216 norm! 1gg0elcWYYY |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2217 call assert_equal('hereZZZareYYYsome words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2218 set cpo+=w |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2219 call setline(1, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2220 norm! 1gg0elcwZZZ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2221 call assert_equal('hereZZZ are some words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2222 norm! 1gg2elcWYYY |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2223 call assert_equal('hereZZZ areYYY some words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2224 set cpo-=w |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2225 norm! 2gg0cwfoo |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2226 call assert_equal('foo', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2227 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2228 call setline(1, 'one; two') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2229 call cursor(1, 1) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2230 call feedkeys('cwvim', 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2231 call assert_equal('vim; two', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2232 call feedkeys('0cWone', 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2233 call assert_equal('one two', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2234 "When cursor is at the end of a word 'ce' will change until the end of the |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2235 "next word, but 'cw' will change only one character |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2236 call setline(1, 'one two') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2237 call feedkeys('0ecwce', 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2238 call assert_equal('once two', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2239 call setline(1, 'one two') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2240 call feedkeys('0ecely', 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2241 call assert_equal('only', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2242 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2243 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2244 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2245 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2246 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2247 " Test for CTRL-\ commands |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2248 func Test_normal40_ctrl_bsl() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2249 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2250 call append(0, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2251 exe "norm! 1gg0a\<C-\>\<C-N>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2252 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2253 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2254 call assert_equal('', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2255 exe "norm! 1gg0viw\<C-\>\<C-N>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2256 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2257 call assert_equal(4, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2258 exe "norm! 1gg0a\<C-\>\<C-G>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2259 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2260 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2261 "imap <buffer> , <c-\><c-n> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2262 set im |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2263 exe ":norm! \<c-\>\<c-n>dw" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2264 set noim |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2265 call assert_equal('are some words', getline(1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2266 call assert_false(&insertmode) |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2267 call assert_beeps("normal! \<C-\>\<C-A>", 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2268 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2269 " Using CTRL-\ CTRL-N in cmd window should close the window |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2270 call feedkeys("q:\<C-\>\<C-N>", 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2271 call assert_equal('', getcmdwintype()) |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2272 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2273 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2274 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2275 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2276 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2277 " Test for <c-r>=, <c-r><c-r>= and <c-r><c-o>= in insert mode |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2278 func Test_normal41_insert_reg() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2279 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2280 set sts=2 sw=2 ts=8 tw=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2281 call append(0, ["aaa\tbbb\tccc", '', '', '']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2282 let a=getline(1) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2283 norm! 2gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2284 exe "norm! a\<c-r>=a\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2285 norm! 3gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2286 exe "norm! a\<c-r>\<c-r>=a\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2287 norm! 4gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2288 exe "norm! a\<c-r>\<c-o>=a\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2289 call assert_equal(['aaa bbb ccc', 'aaa bbb ccc', 'aaa bbb ccc', 'aaa bbb ccc', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2290 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2291 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2292 set sts=0 sw=8 ts=8 |
10124
f6942ed9e998
commit https://github.com/vim/vim/commit/31845093b7f1b33e0c7e9e592bef65528674a1f2
Christian Brabandt <cb@256bit.org>
parents:
10104
diff
changeset
|
2293 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2294 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2295 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2296 " Test for Ctrl-D and Ctrl-U |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2297 func Test_normal42_halfpage() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2298 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2299 call assert_equal(5, &scroll) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2300 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2301 call assert_equal('6', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2302 exe "norm! 2\<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2303 call assert_equal('8', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2304 call assert_equal(2, &scroll) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2305 set scroll=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2306 exe "norm! \<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2307 call assert_equal('3', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2308 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2309 set scrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2310 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2311 call assert_equal('10', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2312 exe "norm! \<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2313 call assert_equal('5', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2314 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2315 set scrolloff=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2316 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2317 call assert_equal('10', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2318 set scrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2319 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2320 exe "norm! $\<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2321 call assert_equal('95', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2322 call assert_equal([0, 95, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2323 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2324 set nostartofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2325 exe "norm! $\<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2326 call assert_equal('95', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2327 call assert_equal([0, 95, 2, 0, 2147483647], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2328 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2329 set startofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2330 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2331 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2332 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2333 " Tests for text object aw |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2334 func Test_normal43_textobject1() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2335 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2336 call append(0, ['foobar,eins,foobar', 'foo,zwei,foo ']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2337 " diw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2338 norm! 1gg0diw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2339 call assert_equal([',eins,foobar', 'foo,zwei,foo ', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2340 " daw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2341 norm! 2ggEdaw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2342 call assert_equal([',eins,foobar', 'foo,zwei,', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2343 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2344 call append(0, ["foo\teins\tfoobar", "foo\tzwei\tfoo "]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2345 " diW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2346 norm! 2ggwd2iW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2347 call assert_equal(['foo eins foobar', 'foo foo ', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2348 " daW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2349 norm! 1ggd2aW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2350 call assert_equal(['foobar', 'foo foo ', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2351 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2352 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2353 call append(0, ["foo\teins\tfoobar", "foo\tzwei\tfoo "]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2354 " aw in visual line mode switches to characterwise mode |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2355 norm! 2gg$Vawd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2356 call assert_equal(['foo eins foobar', 'foo zwei foo'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2357 norm! 1gg$Viwd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2358 call assert_equal(['foo eins ', 'foo zwei foo'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2359 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2360 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2361 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2362 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2363 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2364 " Test for is and as text objects |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2365 func Test_normal44_textobjects2() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2366 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2367 call append(0, ['This is a test. With some sentences!', '', 'Even with a question? And one more. And no sentence here']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2368 " Test for dis - does not remove trailing whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2369 norm! 1gg0dis |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2370 call assert_equal([' With some sentences!', '', 'Even with a question? And one more. And no sentence here', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2371 " Test for das - removes leading whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2372 norm! 3ggf?ldas |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2373 call assert_equal([' With some sentences!', '', 'Even with a question? And no sentence here', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2374 " when used in visual mode, is made characterwise |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2375 norm! 3gg$Visy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2376 call assert_equal('v', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2377 " reset visualmode() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2378 norm! 3ggVy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2379 norm! 3gg$Vasy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2380 call assert_equal('v', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2381 " basic testing for textobjects a< and at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2382 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2383 call setline(1, ['<div> ','<a href="foobar" class="foo">xyz</a>',' </div>', ' ']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2384 " a< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2385 norm! 1gg0da< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2386 call assert_equal([' ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2387 norm! 1pj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2388 call assert_equal([' <div>', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2389 " at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2390 norm! d2at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2391 call assert_equal([' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2392 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2393 call setline(1, ['<div> ','<a href="foobar" class="foo">xyz</a>',' </div>', ' ']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2394 " i< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2395 norm! 1gg0di< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2396 call assert_equal(['<> ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2397 norm! 1Pj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2398 call assert_equal(['<div> ', '<a href="foobar" class="foo">xyz</a>', ' </div>', ' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2399 norm! d2it |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2400 call assert_equal(['<div></div>',' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2401 " basic testing for a[ and i[ text object |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2402 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2403 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2404 norm! 3gg0di[ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2405 call assert_equal([' ', '[', ']'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2406 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2407 norm! 3gg0ftd2a[ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2408 call assert_equal([' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2409 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2410 " Test for i" when cursor is in front of a quoted object |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2411 call append(0, 'foo "bar"') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2412 norm! 1gg0di" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2413 call assert_equal(['foo ""', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2414 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2415 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2416 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2417 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2418 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2419 func Test_normal45_drop() |
13270
f3fb8dae30f1
patch 8.0.1509: test for failing drag-n-drop command no longer fails
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
2420 if !has('dnd') |
13272
abaebba89fd4
patch 8.0.1510: cannot test if a command causes a beep
Christian Brabandt <cb@256bit.org>
parents:
13270
diff
changeset
|
2421 " The ~ register does not exist |
abaebba89fd4
patch 8.0.1510: cannot test if a command causes a beep
Christian Brabandt <cb@256bit.org>
parents:
13270
diff
changeset
|
2422 call assert_beeps('norm! "~') |
13270
f3fb8dae30f1
patch 8.0.1509: test for failing drag-n-drop command no longer fails
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
2423 return |
f3fb8dae30f1
patch 8.0.1509: test for failing drag-n-drop command no longer fails
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
2424 endif |
f3fb8dae30f1
patch 8.0.1509: test for failing drag-n-drop command no longer fails
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
2425 |
f3fb8dae30f1
patch 8.0.1509: test for failing drag-n-drop command no longer fails
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
2426 " basic test for drag-n-drop |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2427 " unfortunately, without a gui, we can't really test much here, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2428 " so simply test that ~p fails (which uses the drop register) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2429 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2430 call assert_fails(':norm! "~p', 'E353') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2431 call assert_equal([], getreg('~', 1, 1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2432 " the ~ register is read only |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2433 call assert_fails(':let @~="1"', 'E354') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2434 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2435 endfunc |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2436 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2437 func Test_normal46_ignore() |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2438 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2439 " How to test this? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2440 " let's just for now test, that the buffer |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2441 " does not change |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2442 call feedkeys("\<c-s>", 't') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2443 call assert_equal([''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2444 |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2445 " no valid commands |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2446 exe "norm! \<char-0x100>" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2447 call assert_equal([''], getline(1,'$')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2448 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2449 exe "norm! ä" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2450 call assert_equal([''], getline(1,'$')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2451 |
10088
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2452 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2453 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2454 endfunc |
10154
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2455 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2456 func Test_normal47_visual_buf_wipe() |
10154
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2457 " This was causing a crash or ml_get error. |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2458 enew! |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2459 call setline(1,'xxx') |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2460 normal $ |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2461 new |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2462 call setline(1, range(1,2)) |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2463 2 |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2464 exe "norm \<C-V>$" |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2465 bw! |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2466 norm yp |
4647267906cc
commit https://github.com/vim/vim/commit/c4a908e83690844b0d3a46124ba6af7d23485d69
Christian Brabandt <cb@256bit.org>
parents:
10130
diff
changeset
|
2467 set nomodified |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2468 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2469 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2470 func Test_normal47_autocmd() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2471 " disabled, does not seem to be possible currently |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2472 throw "Skipped: not possible to test cursorhold autocmd while waiting for input in normal_cmd" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2473 new |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2474 call append(0, repeat('-',20)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2475 au CursorHold * call feedkeys('2l', '') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2476 1 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2477 set updatetime=20 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2478 " should delete 12 chars (d12l) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2479 call feedkeys('d1', '!') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2480 call assert_equal('--------', getline(1)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2481 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2482 " clean up |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2483 au! CursorHold |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2484 set updatetime=4000 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2485 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2486 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2487 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2488 func Test_normal48_wincmd() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2489 new |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2490 exe "norm! \<c-w>c" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2491 call assert_equal(1, winnr('$')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2492 call assert_fails(":norm! \<c-w>c", "E444") |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2493 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2494 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2495 func Test_normal49_counts() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2496 new |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2497 call setline(1, 'one two three four five six seven eight nine ten') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2498 1 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2499 norm! 3d2w |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2500 call assert_equal('seven eight nine ten', getline(1)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2501 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2502 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2503 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2504 func Test_normal50_commandline() |
12477
68d7bc045dbe
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Christian Brabandt <cb@256bit.org>
parents:
12421
diff
changeset
|
2505 if !has("timers") || !has("cmdline_hist") |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2506 return |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2507 endif |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2508 func! DoTimerWork(id) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2509 call assert_equal('[Command Line]', bufname('')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2510 " should fail, with E11, but does fail with E23? |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2511 "call feedkeys("\<c-^>", 'tm') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2512 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2513 " should also fail with E11 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2514 call assert_fails(":wincmd p", 'E11') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2515 " return from commandline window |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2516 call feedkeys("\<cr>") |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2517 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2518 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2519 let oldlang=v:lang |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2520 lang C |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2521 set updatetime=20 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2522 call timer_start(100, 'DoTimerWork') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2523 try |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2524 " throws E23, for whatever reason... |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2525 call feedkeys('q:', 'x!') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2526 catch /E23/ |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2527 " no-op |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2528 endtry |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2529 " clean up |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2530 set updatetime=4000 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2531 exe "lang" oldlang |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2532 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2533 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2534 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2535 func Test_normal51_FileChangedRO() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2536 if !has("autocmd") |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2537 return |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2538 endif |
10807
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
2539 " Don't sleep after the warning message. |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
2540 call test_settime(1) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2541 call writefile(['foo'], 'Xreadonly.log') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2542 new Xreadonly.log |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2543 setl ro |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2544 au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2545 call assert_fails(":norm! Af", 'E788') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2546 call assert_equal(['foo'], getline(1,'$')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2547 call assert_equal('Xreadonly.log', bufname('')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2548 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2549 " cleanup |
10807
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10579
diff
changeset
|
2550 call test_settime(0) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2551 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2552 call delete("Xreadonly.log") |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2553 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2554 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2555 func Test_normal52_rl() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2556 if !has("rightleft") |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2557 return |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2558 endif |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2559 new |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2560 call setline(1, 'abcde fghij klmnopq') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2561 norm! 1gg$ |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2562 set rl |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2563 call assert_equal(19, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2564 call feedkeys('l', 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2565 call assert_equal(18, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2566 call feedkeys('h', 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2567 call assert_equal(19, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2568 call feedkeys("\<right>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2569 call assert_equal(18, col('.')) |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2570 call feedkeys("\<left>", 'tx') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2571 call assert_equal(19, col('.')) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2572 call feedkeys("\<s-right>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2573 call assert_equal(13, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2574 call feedkeys("\<c-right>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2575 call assert_equal(7, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2576 call feedkeys("\<c-left>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2577 call assert_equal(13, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2578 call feedkeys("\<s-left>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2579 call assert_equal(19, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2580 call feedkeys("<<", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2581 call assert_equal(' abcde fghij klmnopq',getline(1)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2582 call feedkeys(">>", 'tx') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2583 call assert_equal('abcde fghij klmnopq',getline(1)) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2584 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2585 " cleanup |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2586 set norl |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2587 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2588 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2589 |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2590 func Test_normal53_digraph() |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2591 if !has('digraphs') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2592 return |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2593 endif |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2594 new |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2595 call setline(1, 'abcdefgh|') |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2596 exe "norm! 1gg0f\<c-k>!!" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2597 call assert_equal(9, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2598 set cpo+=D |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2599 exe "norm! 1gg0f\<c-k>!!" |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2600 call assert_equal(1, col('.')) |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2601 |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2602 set cpo-=D |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2603 bw! |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2604 endfunc |
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2605 |
11260
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2606 func Test_normal54_Ctrl_bsl() |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2607 new |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2608 call setline(1, 'abcdefghijklmn') |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2609 exe "norm! df\<c-\>\<c-n>" |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2610 call assert_equal(['abcdefghijklmn'], getline(1,'$')) |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2611 exe "norm! df\<c-\>\<c-g>" |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2612 call assert_equal(['abcdefghijklmn'], getline(1,'$')) |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2613 exe "norm! df\<c-\>m" |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2614 call assert_equal(['abcdefghijklmn'], getline(1,'$')) |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
2615 |
11260
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2616 call setline(2, 'abcdefghijklmnāf') |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2617 norm! 2gg0 |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2618 exe "norm! df\<Char-0x101>" |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2619 call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$')) |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2620 norm! 1gg0 |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2621 exe "norm! df\<esc>" |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2622 call assert_equal(['abcdefghijklmn', 'f'], getline(1,'$')) |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2623 |
11260
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2624 " clean up |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2625 bw! |
10166
520e0e732b87
commit https://github.com/vim/vim/commit/2931f2a5df0d962032d41060af84d9fd2cb35c9f
Christian Brabandt <cb@256bit.org>
parents:
10154
diff
changeset
|
2626 endfunc |
11260
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2627 |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2628 func Test_normal_large_count() |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2629 " This may fail with 32bit long, how do we detect that? |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2630 new |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2631 normal o |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2632 normal 6666666666dL |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2633 bwipe! |
a7b7b21071c6
patch 8.0.0516: a large count on a normal command causes trouble
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
2634 endfunc |
11275
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2635 |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2636 func Test_delete_until_paragraph() |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2637 new |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2638 normal grádv} |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2639 call assert_equal('á', getline(1)) |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2640 normal grád} |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2641 call assert_equal('', getline(1)) |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2642 bwipe! |
5c77ca0cf6a5
patch 8.0.0523: dv} deletes part of a multi-byte character.
Christian Brabandt <cb@256bit.org>
parents:
11260
diff
changeset
|
2643 endfunc |
12788
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2644 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2645 " Test for the gr (virtual replace) command |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2646 " Test for the bug fixed by 7.4.387 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2647 func Test_gr_command() |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2648 enew! |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2649 let save_cpo = &cpo |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2650 call append(0, ['First line', 'Second line', 'Third line']) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2651 exe "normal i\<C-G>u" |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2652 call cursor(2, 1) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2653 set cpo-=X |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2654 normal 4gro |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2655 call assert_equal('oooond line', getline(2)) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2656 undo |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2657 set cpo+=X |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2658 normal 4gro |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2659 call assert_equal('ooooecond line', getline(2)) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2660 let &cpo = save_cpo |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2661 normal! ggvegrx |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2662 call assert_equal('xxxxx line', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2663 exe "normal! gggr\<C-V>122" |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2664 call assert_equal('zxxxx line', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2665 set virtualedit=all |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2666 normal! 15|grl |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2667 call assert_equal('zxxxx line l', getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2668 set virtualedit& |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2669 set nomodifiable |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2670 call assert_fails('normal! grx', 'E21:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2671 call assert_fails('normal! gRx', 'E21:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2672 set modifiable& |
12788
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2673 enew! |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2674 endfunc |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2675 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2676 " When splitting a window the changelist position is wrong. |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2677 " Test the changelist position after splitting a window. |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2678 " Test for the bug fixed by 7.4.386 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2679 func Test_changelist() |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2680 let save_ul = &ul |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2681 enew! |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2682 call append('$', ['1', '2']) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2683 exe "normal i\<C-G>u" |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2684 exe "normal Gkylpa\<C-G>u" |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2685 set ul=100 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2686 exe "normal Gylpa\<C-G>u" |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2687 set ul=100 |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2688 normal gg |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2689 vsplit |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2690 normal g; |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2691 call assert_equal([3, 2], [line('.'), col('.')]) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2692 normal g; |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2693 call assert_equal([2, 2], [line('.'), col('.')]) |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2694 call assert_fails('normal g;', 'E662:') |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2695 new |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2696 call assert_fails('normal g;', 'E664:') |
12788
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2697 %bwipe! |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2698 let &ul = save_ul |
cb9b2774f21f
patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12730
diff
changeset
|
2699 endfunc |
15006
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2700 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2701 func Test_nv_hat_count() |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2702 %bwipeout! |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2703 let l:nr = bufnr('%') + 1 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2704 call assert_fails(':execute "normal! ' . l:nr . '\<C-^>"', 'E92') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2705 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2706 edit Xfoo |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2707 let l:foo_nr = bufnr('Xfoo') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2708 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2709 edit Xbar |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2710 let l:bar_nr = bufnr('Xbar') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2711 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2712 " Make sure we are not just using the alternate file. |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2713 edit Xbaz |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2714 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2715 call feedkeys(l:foo_nr . "\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2716 call assert_equal('Xfoo', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2717 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2718 call feedkeys(l:bar_nr . "\<C-^>", 'tx') |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2719 call assert_equal('Xbar', fnamemodify(bufname('%'), ':t')) |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2720 |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2721 %bwipeout! |
1fd8e32532f7
patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents:
14669
diff
changeset
|
2722 endfunc |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2723 |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2724 func Test_message_when_using_ctrl_c() |
16095
4673f22da44d
patch 8.1.1052: test for CTRL-C message sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
16089
diff
changeset
|
2725 " Make sure no buffers are changed. |
4673f22da44d
patch 8.1.1052: test for CTRL-C message sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
16089
diff
changeset
|
2726 %bwipe! |
4673f22da44d
patch 8.1.1052: test for CTRL-C message sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
16089
diff
changeset
|
2727 |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2728 exe "normal \<C-C>" |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2729 call assert_match("Type :qa and press <Enter> to exit Vim", Screenline(&lines)) |
16095
4673f22da44d
patch 8.1.1052: test for CTRL-C message sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
16089
diff
changeset
|
2730 |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2731 new |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2732 cal setline(1, 'hi!') |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2733 exe "normal \<C-C>" |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2734 call assert_match("Type :qa! and press <Enter> to abandon all changes and exit Vim", Screenline(&lines)) |
16095
4673f22da44d
patch 8.1.1052: test for CTRL-C message sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
16089
diff
changeset
|
2735 |
16089
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2736 bwipe! |
4411c38f3d16
patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
2737 endfunc |
16419
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2738 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2739 " Test for '[m', ']m', '[M' and ']M' |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2740 " Jumping to beginning and end of methods in Java-like languages |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2741 func Test_java_motion() |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2742 new |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2743 call assert_beeps('normal! [m') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2744 call assert_beeps('normal! ]m') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2745 call assert_beeps('normal! [M') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2746 call assert_beeps('normal! ]M') |
16419
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2747 a |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2748 Piece of Java |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2749 { |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2750 tt m1 { |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2751 t1; |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2752 } e1 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2753 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2754 tt m2 { |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2755 t2; |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2756 } e2 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2757 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2758 tt m3 { |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2759 if (x) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2760 { |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2761 t3; |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2762 } |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2763 } e3 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2764 } |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2765 . |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2766 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2767 normal gg |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2768 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2769 normal 2]maA |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2770 call assert_equal("\ttt m1 {A", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2771 call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2772 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2773 normal j]maB |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2774 call assert_equal("\ttt m2 {B", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2775 call assert_equal([7, 9, 16], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2776 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2777 normal ]maC |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2778 call assert_equal("\ttt m3 {C", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2779 call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2780 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2781 normal [maD |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2782 call assert_equal("\ttt m3 {DC", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2783 call assert_equal([11, 9, 16], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2784 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2785 normal k2[maE |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2786 call assert_equal("\ttt m1 {EA", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2787 call assert_equal([3, 9, 16], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2788 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2789 normal 3[maF |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2790 call assert_equal("{F", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2791 call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2792 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2793 normal ]MaG |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2794 call assert_equal("\t}G e1", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2795 call assert_equal([5, 3, 10], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2796 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2797 normal j2]MaH |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2798 call assert_equal("\t}H e3", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2799 call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2800 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2801 normal ]M]M |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2802 normal aI |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2803 call assert_equal("}I", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2804 call assert_equal([17, 2, 2], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2805 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2806 normal 2[MaJ |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2807 call assert_equal("\t}JH e3", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2808 call assert_equal([16, 3, 10], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2809 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2810 normal k[MaK |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2811 call assert_equal("\t}K e2", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2812 call assert_equal([9, 3, 10], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2813 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2814 normal 3[MaL |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2815 call assert_equal("{LF", getline('.')) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2816 call assert_equal([2, 2, 2], [line('.'), col('.'), virtcol('.')]) |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2817 |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2818 close! |
aebcd20a8a3f
patch 8.1.1214: old style tests
Bram Moolenaar <Bram@vim.org>
parents:
16095
diff
changeset
|
2819 endfunc |
17520
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2820 |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
2821 func Test_normal_gdollar_cmd() |
17520
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2822 if !has("jumplist") |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2823 return |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2824 endif |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2825 " Tests for g cmds |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2826 call Setup_NewWindow() |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2827 " Make long lines that will wrap |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2828 %s/$/\=repeat(' foobar', 10)/ |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2829 20vsp |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2830 set wrap |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2831 " Test for g$ with count |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2832 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2833 norm! 0vg$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2834 call assert_equal(20, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2835 call assert_equal('1 foobar foobar foob', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2836 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2837 norm! 0v4g$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2838 call assert_equal(72, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2839 call assert_equal('1 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.."\n", getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2840 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2841 norm! 0v6g$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2842 call assert_equal(40, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2843 call assert_equal('1 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2844 \ '2 foobar foobar foobar foobar foobar foo', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2845 set nowrap |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2846 " clean up |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2847 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2848 norm! 0vg$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2849 call assert_equal(20, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2850 call assert_equal('1 foobar foobar foob', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2851 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2852 norm! 0v4g$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2853 call assert_equal(20, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2854 call assert_equal('1 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2855 \ '2 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2856 \ '3 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2857 \ '4 foobar foobar foob', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2858 norm! gg |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2859 norm! 0v6g$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2860 call assert_equal(20, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2861 call assert_equal('1 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2862 \ '2 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2863 \ '3 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2864 \ '4 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2865 \ '5 foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'.. "\n".. |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2866 \ '6 foobar foobar foob', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2867 " Move to last line, also down movement is not possible, should still move |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2868 " the cursor to the last visible char |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2869 norm! G |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2870 norm! 0v6g$y |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2871 call assert_equal(20, col("'>")) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2872 call assert_equal('100 foobar foobar fo', getreg(0)) |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2873 bw! |
827d29c8f7e8
patch 8.1.1758: count of g$ not used correctly when text is not wrapped
Bram Moolenaar <Bram@vim.org>
parents:
17172
diff
changeset
|
2874 endfunc |
18154
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2875 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2876 func Test_normal_gk_gj() |
18154
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2877 " needs 80 column new window |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2878 new |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2879 vert 80new |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2880 call assert_beeps('normal gk') |
18154
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2881 put =[repeat('x',90)..' {{{1', 'x {{{1'] |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2882 norm! gk |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2883 " In a 80 column wide terminal the window will be only 78 char |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2884 " (because Vim will leave space for the other window), |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2885 " but if the terminal is larger, it will be 80 chars, so verify the |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2886 " cursor column correctly. |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2887 call assert_equal(winwidth(0)+1, col('.')) |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2888 call assert_equal(winwidth(0)+1, virtcol('.')) |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2889 norm! j |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2890 call assert_equal(6, col('.')) |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2891 call assert_equal(6, virtcol('.')) |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2892 norm! gk |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2893 call assert_equal(95, col('.')) |
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2894 call assert_equal(95, virtcol('.')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2895 %bw! |
18291
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2896 |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2897 " needs 80 column new window |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2898 new |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2899 vert 80new |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2900 call assert_beeps('normal gj') |
18291
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2901 set number |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2902 set numberwidth=10 |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2903 set cpoptions+=n |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2904 put =[repeat('0',90), repeat('1',90)] |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2905 norm! 075l |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2906 call assert_equal(76, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2907 norm! gk |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2908 call assert_equal(1, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2909 norm! gk |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2910 call assert_equal(76, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2911 norm! gk |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2912 call assert_equal(1, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2913 norm! gj |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2914 call assert_equal(76, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2915 norm! gj |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2916 call assert_equal(1, col('.')) |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2917 norm! gj |
11f68eb58fda
patch 8.1.2140: "gk" and "gj" do not work correctly in number column
Bram Moolenaar <Bram@vim.org>
parents:
18154
diff
changeset
|
2918 call assert_equal(76, col('.')) |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2919 " When 'nowrap' is set, gk and gj behave like k and j |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2920 set nowrap |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2921 normal! gk |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2922 call assert_equal([2, 76], [line('.'), col('.')]) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2923 normal! gj |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2924 call assert_equal([3, 76], [line('.'), col('.')]) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2925 %bw! |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2926 set cpoptions& number& numberwidth& wrap& |
18154
5e10ee16f4b4
patch 8.1.2072: "gk" moves to start of line instead of upwards
Bram Moolenaar <Bram@vim.org>
parents:
17698
diff
changeset
|
2927 endfunc |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2928 |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2929 " Test for cursor movement with '-' in 'cpoptions' |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2930 func Test_normal_cpo_minus() |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2931 new |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2932 call setline(1, ['foo', 'bar', 'baz']) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2933 let save_cpo = &cpo |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2934 set cpo+=- |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2935 call assert_beeps('normal 10j') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2936 call assert_equal(1, line('.')) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2937 normal G |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2938 call assert_beeps('normal 10k') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2939 call assert_equal(3, line('.')) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2940 call assert_fails(10, 'E16:') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2941 let &cpo = save_cpo |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2942 close! |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
2943 endfunc |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2944 |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2945 " Test for displaying dollar when changing text ('$' flag in 'cpoptions') |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2946 func Test_normal_cpo_dollar() |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2947 new |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2948 let g:Line = '' |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2949 func SaveFirstLine() |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2950 let g:Line = Screenline(1) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2951 return '' |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2952 endfunc |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2953 inoremap <expr> <buffer> <F2> SaveFirstLine() |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2954 call test_override('redraw_flag', 1) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2955 set cpo+=$ |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2956 call setline(1, 'one two three') |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2957 redraw! |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2958 exe "normal c2w\<F2>vim" |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2959 call assert_equal('one tw$ three', g:Line) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2960 call assert_equal('vim three', getline(1)) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2961 set cpo-=$ |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2962 call test_override('ALL', 0) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2963 delfunc SaveFirstLine |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2964 %bw! |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2965 endfunc |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19738
diff
changeset
|
2966 |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2967 " Test for using : to run a multi-line Ex command in operator pending mode |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2968 func Test_normal_yank_with_excmd() |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2969 new |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2970 call setline(1, ['foo', 'bar', 'baz']) |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2971 let @a = '' |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2972 call feedkeys("\"ay:if v:true\<CR>normal l\<CR>endif\<CR>", 'xt') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2973 call assert_equal('f', @a) |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2974 close! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
2975 endfunc |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2976 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2977 " Test for supplying a count to a normal-mode command across a cursorhold call |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2978 func Test_normal_cursorhold_with_count() |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2979 func s:cHold() |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2980 let g:cHold_Called += 1 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2981 endfunc |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2982 new |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2983 augroup normalcHoldTest |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2984 au! |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2985 au CursorHold <buffer> call s:cHold() |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2986 augroup END |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2987 let g:cHold_Called = 0 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2988 call feedkeys("3\<CursorHold>2ix", 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2989 call assert_equal(1, g:cHold_Called) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2990 call assert_equal(repeat('x', 32), getline(1)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2991 augroup normalcHoldTest |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2992 au! |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2993 augroup END |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2994 au! normalcHoldTest |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2995 close! |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2996 delfunc s:cHold |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2997 endfunc |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2998 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
2999 " Test for using a count and a command with CTRL-W |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3000 func Test_wincmd_with_count() |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3001 call feedkeys("\<C-W>12n", 'xt') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3002 call assert_equal(12, winheight(0)) |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3003 endfunc |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3004 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3005 " Test for 'b', 'B' 'ge' and 'gE' commands |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3006 func Test_horiz_motion() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3007 new |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3008 normal! gg |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3009 call assert_beeps('normal! b') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3010 call assert_beeps('normal! B') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3011 call assert_beeps('normal! gE') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3012 call assert_beeps('normal! ge') |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3013 " <S-Backspace> moves one word left and <C-Backspace> moves one WORD left |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3014 call setline(1, 'one ,two ,three') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3015 exe "normal! $\<S-BS>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3016 call assert_equal(11, col('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3017 exe "normal! $\<C-BS>" |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3018 call assert_equal(10, col('.')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3019 close! |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3020 endfunc |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3021 |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3022 " Test for using a : command in operator pending mode |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3023 func Test_normal_colon_op() |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3024 new |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3025 call setline(1, ['one', 'two']) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3026 call assert_beeps("normal! Gc:d\<CR>") |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
3027 close! |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3028 endfunc |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3029 |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
3030 " vim: shiftwidth=2 sts=2 expandtab |