Mercurial > vim
annotate src/testdir/test_normal.vim @ 10088:5337340beea0 v7.4.2315
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 3 17:33:54 2016 +0200
patch 7.4.2315
Problem: Insufficient testing for Normal mode commands.
Solution: Add a big test. (Christian Brabandt, closes https://github.com/vim/vim/issues/1029)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 03 Sep 2016 17:45:06 +0200 |
parents | |
children | d7846e9fbf65 |
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 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func! Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 call setline(1, range(1,100)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 endfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 func! MyFormatExpr() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 " 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
|
10 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
|
11 let line = getline(ln) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 if getline(ln) =~# '\d\s\+$' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call setline(ln, substitute(line, '\s\+$', '', '') . '->$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 function! CountSpaces(type, ...) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 " for testing operatorfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " will count the number of spaces |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " and return the result in g:a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 let sel_save = &selection |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 let &selection = "inclusive" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 let reg_save = @@ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 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
|
27 silent exe "normal! gvy" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 elseif a:type == 'line' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 silent exe "normal! '[V']y" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 else |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 silent exe "normal! `[v`]y" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let g:a=strlen(substitute(@@, '[^ ]', '', 'g')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 let &selection = sel_save |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 let @@ = reg_save |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfunction |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 fun! Test_normal00_optrans() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 " Attention: This needs to be the very first test, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 " it will fail, if it runs later, don't know why! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 " Test for S s and alike comamnds, that are internally handled aliased |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 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
|
44 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 exe "norm! Sfoobar\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 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
|
47 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 " Test does not work |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 " TODO: Why does it not work? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 " Adds an additional linebreak if used in visual mode... |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 " When run in the test, this returns: |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 " ,-------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 " |foobar |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 " |2 This is |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 " |the second |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 " |one |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 " |3 this is the third line |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 " `----------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 " instead of |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 " ,-------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 " |foobar |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 " |2 This is the second one |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 " |3 this is the third line |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 " `----------- |
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 " When run in the test, this returns: |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 " ,-------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 " |foobar |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 " |Second line |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 " |here |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 " |3 this is the third line |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 " `----------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 " instead of |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 " ,-------- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 " |foobar |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 " |Second line here |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 " |3 this is the third line |
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 norm! VS Second line here |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 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
|
82 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 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
|
84 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
|
85 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 norm! 2D |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 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
|
89 set cpo+=# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 norm! 4D |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 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
|
92 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 set cpo-=# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 func! Test_normal01_keymodel() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 " Test 1: depending on 'keymodel' <s-down> does something different |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 :50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 call feedkeys("V\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 call assert_equal(['47', '48', '49', '50'], getline("'<", "'>")) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 :set keymodel=startsel |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 :50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 call feedkeys("V\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 call assert_equal(['49', '50'], getline("'<", "'>")) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 " Start visual mode when keymodel = startsel |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 :50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 call feedkeys("\<S-Up>y", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 call assert_equal(['49', '5'], getreg(0, 0, 1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 " Do not start visual mode when keymodel= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 :set keymodel= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 :50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 call feedkeys("\<S-Up>y$", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 call assert_equal(['42'], getreg(0, 0, 1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 endfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 func! Test_normal02_selectmode() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 " some basic select mode tests |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 norm! gHy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 call assert_equal('y51', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 call setline(1, range(1,100)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 exe ":norm! V9jo\<c-g>y" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 call assert_equal('y60', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 func! Test_normal03_join() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 " basic join test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 norm! VJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 call assert_equal('50 51', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 norm! J |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 call assert_equal('100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 norm! V9-gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 call assert_equal('919293949596979899100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 call setline(1, range(1,100)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 :j 10 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 call assert_equal('100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 func! Test_normal04_filter() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 " basic filter test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 " only test on non windows platform |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 if has("win32") || has("win64") || has("win95") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call feedkeys("!!sed -e 's/^/| /'\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 call assert_equal('| 1', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 90 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 :sil :!echo one |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 call feedkeys('.', 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 call assert_equal('| 90', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 95 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 set cpo+=! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 " 2 <CR>, 1: for executing the command, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 " 2: clear hit-enter-prompt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 call feedkeys("!!\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 call feedkeys(":!echo one\n\n", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 call feedkeys(".", 'tx') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 call assert_equal('one', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 set cpo-=! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 func! Test_normal05_formatexpr() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 " basic formatexpr test |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 %d_ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 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
|
187 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 set formatexpr=MyFormatExpr() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 norm! gqG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 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
|
191 set formatexpr= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 func! Test_normal06_formatprg() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 " basic test for formatprg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 " only test on non windows platform |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 if has("win32") || has("win64") || has("win95") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 else |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 " uses sed to number non-empty lines |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 call system('chmod +x ./Xsed_format.sh') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 call setline(1, ['a', '', 'c', '', ' ', 'd', 'e']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
208 set formatprg=./Xsed_format.sh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 norm! gggqG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 call assert_equal(['1 a', '', '3 c', '', '5 ', '6 d', '7 e'], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
212 set formatprg= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 call delete('Xsed_format.sh') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
214 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
215 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
216 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
217 func! Test_normal07_internalfmt() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
218 " 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
|
219 let list=range(1,11) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
220 call map(list, 'v:val." "') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
221 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 call setline(1, list) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 set tw=12 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 norm! gggqG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 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
|
226 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 set formatprg= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
228 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 func! Test_normal08_fold() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 " basic tests for foldopen/folddelete |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 if !has("folding") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
235 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
238 setl foldenable fdm=marker |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 " First fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
240 norm! V4jzf |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
242 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
|
243 " Second fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 46 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 norm! V10jzf |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
246 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 call assert_equal('46/*{{{*/', getline(46)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 call assert_equal('60/*}}}*/', getline(60)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 call assert_equal('45', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
252 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
253 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
254 call assert_equal('61', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
256 " open a fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
257 norm! Vzo |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
258 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
259 call assert_equal('45', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
260 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
261 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
262 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
263 call assert_equal('47', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 norm! zcVzO |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 call assert_equal('46/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
267 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 call assert_equal('47', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
269 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
270 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
271 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
272 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
273 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
274 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
275 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 call assert_equal('51', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 " delete folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 :46 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 " collapse fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 norm! V14jzC |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
281 " delete all folds recursively |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 norm! VzD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 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
|
284 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 setl nofoldenable fdm=marker |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
287 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
288 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
290 func! Test_normal09_operatorfunc() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
291 " Test operatorfunc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
293 " Add some spaces for counting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
294 50,60s/$/ / |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
295 unlet! g:a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
296 let g:a=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 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
|
298 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
|
299 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
300 norm V2j,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
301 call assert_equal(6, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
302 norm V,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
303 call assert_equal(2, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 norm ,,l |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 call assert_equal(0, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
306 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 exe "norm 0\<c-v>10j2l,," |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 call assert_equal(11, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
309 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
310 norm V10j,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
311 call assert_equal(22, g:a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
312 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
313 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
314 unmap <buffer> ,, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
315 set opfunc= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
316 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
317 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
319 func! Test_normal10_expand() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
320 " Test for expand() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
321 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
322 call setline(1, ['1', 'ifooar,,cbar']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
323 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
324 norm! $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
325 let a=expand('<cword>') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
326 let b=expand('<cWORD>') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
327 call assert_equal('cbar', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
328 call assert_equal('ifooar,,cbar', b) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
329 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
330 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
331 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
332 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
333 func! Test_normal11_showcmd() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
334 " test for 'showcmd' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
335 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
336 exe "norm! ofoobar\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
337 call assert_equal(2, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
338 set showcmd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
339 exe "norm! ofoobar2\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
340 call assert_equal(3, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
341 exe "norm! VAfoobar3\<esc>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
342 call assert_equal(3, line('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
343 exe "norm! 0d3\<del>2l" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
344 call assert_equal('obar2foobar3', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
345 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
346 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
347 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
348 func! Test_normal12_nv_error() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
349 " Test for nv_error |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
350 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
351 call setline(1, range(1,5)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
352 " should not do anything, just beep |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
353 exe "norm! <c-k>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
354 call assert_equal(map(range(1,5), 'string(v:val)'), getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
355 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
356 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
357 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
358 func! Test_normal13_help() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
359 " Test for F1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
360 call assert_equal(1, winnr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
361 call feedkeys("\<f1>", 'txi') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
362 call assert_match('help\.txt', bufname('%')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
363 call assert_equal(2, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
364 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
365 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
366 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
367 func! Test_normal14_page() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
368 " 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
|
369 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
370 exe "norm! \<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
371 call assert_equal('9', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
372 exe "norm! 2\<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
373 call assert_equal('25', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
374 exe "norm! 2\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
375 call assert_equal('18', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
376 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
377 set scrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
378 exe "norm! 2\<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
379 call assert_equal('21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
380 exe "norm! \<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
381 call assert_equal('13', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
382 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
383 set scrolloff=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
384 exe "norm! \<c-f>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
385 call assert_equal('13', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
386 set scrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
387 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
388 exe "norm! $\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
389 call assert_equal('92', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
390 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
|
391 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
392 set nostartofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
393 exe "norm! $\<c-b>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
394 call assert_equal('92', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
395 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
|
396 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
397 set startofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
398 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
399 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
400 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
401 func! Test_normal15_z_scroll_vert() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
402 " 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
|
403 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
404 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
405 norm! >> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
406 " Test for z<cr> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
407 exe "norm! z\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
408 call assert_equal(' 100', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
409 call assert_equal(100, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
410 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
|
411 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
412 " Test for zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
413 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
414 norm! >>0zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
415 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
416 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
417 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
|
418 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
419 " Test for zb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
420 30 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
421 norm! >>$ztzb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
422 call assert_equal(' 30', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
423 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
|
424 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
|
425 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
426 " Test for z- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
427 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
428 30 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
429 norm! 0z- |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
430 call assert_equal(' 30', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
431 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
|
432 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
|
433 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
434 " Test for z{height}<cr> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
435 call assert_equal(10, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
436 exe "norm! z12\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
437 call assert_equal(12, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
438 exe "norm! z10\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
439 call assert_equal(10, winheight(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
440 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
441 " Test for z. |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
442 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
443 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
444 norm! 0z. |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
445 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
446 call assert_equal(17, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
447 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
|
448 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
449 " Test for zz |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
450 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
451 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
452 norm! 0zz |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
453 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
454 call assert_equal(17, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
455 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
|
456 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
457 " Test for z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
458 11 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
459 norm! zt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
460 norm! z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
461 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
462 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
463 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
|
464 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
465 " Test for [count]z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
466 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
467 norm! 21z+ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
468 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
469 call assert_equal(21, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
470 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
|
471 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
472 " Test for z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
473 norm! 22z+0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
474 norm! z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
475 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
476 call assert_equal(12, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
477 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
|
478 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
479 " Test for [count]z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
480 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
481 norm! 30z^ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
482 call assert_equal(' 21', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
483 call assert_equal(12, winsaveview()['topline']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
484 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
|
485 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
486 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
487 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
488 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
489 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
490 func! Test_normal16_z_scroll_hor() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
491 " 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
|
492 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
493 15vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
494 set nowrap listchars= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
495 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
496 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
497 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
498 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
499 1d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
500 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
501 " Test for zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
502 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
503 norm! 5zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
504 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
505 call assert_equal(6, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
506 call assert_equal(5, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
507 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
508 call assert_equal('f', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
509 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
510 " Test for zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
511 norm! 2zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
512 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
513 call assert_equal(6, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
514 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
515 call assert_equal('f', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
516 call assert_equal(3, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
517 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
518 " Test for zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
519 norm! zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
520 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
521 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
522 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
523 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
524 norm! 2zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
525 call assert_equal(25, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
526 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
527 call assert_equal('y', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
528 call assert_equal(24, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
529 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
530 " Test for zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
531 norm! 2zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
532 call assert_equal(25, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
533 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
534 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
535 call assert_equal('y', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
536 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
537 " Test for zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
538 norm! $zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
539 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
540 call assert_equal(25, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
541 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
542 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
543 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
544 " Test for ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
545 norm! ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
546 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
547 call assert_equal(11, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
548 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
549 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
550 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
551 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
552 set wrap listchars=eol:$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
553 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
554 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
555 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
556 func! Test_normal17_z_scroll_hor2() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
557 " 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
|
558 " using 'sidescrolloff' setting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
559 10new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
560 20vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
561 set nowrap listchars= sidescrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
562 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
563 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
564 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
565 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
566 1d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
567 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
568 " Test for zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
569 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
570 norm! 5zl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
571 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
572 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
573 call assert_equal(5, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
574 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
575 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
576 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
577 " Test for zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
578 norm! 2zh |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
579 call assert_equal(lineA, getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
580 call assert_equal(11, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
581 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
582 call assert_equal('k', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
583 call assert_equal(3, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
584 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
585 " Test for zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
586 norm! 0zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
587 call assert_equal(16, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
588 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
589 call assert_equal('p', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
590 call assert_equal(10, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
591 norm! 2zL |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
592 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
593 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
594 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
595 call assert_equal(15, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
596 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
597 " Test for zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
598 norm! 2zH |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
599 call assert_equal(15, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
600 call assert_equal(0, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
601 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
602 call assert_equal('o', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
603 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
604 " Test for zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
605 norm! $zs |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
606 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
607 call assert_equal(20, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
608 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
609 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
610 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
611 " Test for ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
612 norm! ze |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
613 call assert_equal(26, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
614 call assert_equal(11, winsaveview()['leftcol']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
615 norm! yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
616 call assert_equal('z', @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
617 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
618 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
619 set wrap listchars=eol:$ sidescrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
620 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
621 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
622 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
623 func! Test_normal18_z_fold() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
624 " basic tests for foldopen/folddelete |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
625 if !has("folding") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
626 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
627 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
628 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
629 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
630 setl foldenable fdm=marker foldlevel=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
631 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
632 " Test for zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
633 " First fold |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
634 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
635 " check that folds have been created |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
636 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
|
637 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
638 " Test for zd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
639 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
640 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
641 call assert_equal(2, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
642 norm! kzd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
643 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
|
644 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
645 call assert_equal(1, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
646 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
647 " Test for zD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
648 " also deletes partially selected folds recursively |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
649 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
650 norm! zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
651 call assert_equal(2, foldlevel('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
652 norm! kV2jzD |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
653 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
|
654 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
655 " Test for zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
656 85 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
657 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
658 86 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
659 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
660 90 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
661 norm! 4zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
662 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
|
663 norm! zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
664 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
|
665 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
666 " Test for zn |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
667 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
668 set foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
669 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
670 norm! zn |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
671 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
672 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
673 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
674 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
675 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
676 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
677 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
678 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
679 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
680 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
681 " Test for zN |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
682 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
683 norm! zN |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
684 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
685 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
686 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
687 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
688 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
689 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
690 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
691 " Test for zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
692 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
693 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
694 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
695 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
696 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
697 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
698 norm! zi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
699 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
700 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
701 " Test for za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
702 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
703 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
704 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
705 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
706 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
707 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
708 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
709 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
710 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
711 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
712 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
713 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
714 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
715 call assert_equal('49', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
716 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
717 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
718 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
719 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
720 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
721 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
722 norm! 5zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
723 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
724 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
725 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
726 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
727 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
728 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
729 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
730 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
731 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
732 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
733 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
734 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
735 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
736 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
737 " close fold and set foldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
738 norm! za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
739 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
740 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
741 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
742 " 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
|
743 norm! 2za |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
744 norm! 2k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
745 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
746 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
747 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
748 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
749 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
750 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
751 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
752 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
753 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
754 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
755 " Test for zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
756 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
757 set foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
758 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
759 norm! zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
760 norm! 2k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
761 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
762 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
763 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
764 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
765 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
766 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
767 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
768 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
769 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
770 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
771 " zA on a opened fold when foldenale is not set |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
772 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
773 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
774 norm! zA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
775 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
776 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
777 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
778 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
779 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
780 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
781 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
782 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
783 " Test for zc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
784 norm! zE |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
785 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
786 norm! 2zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
787 49 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
788 norm! 5zF |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
789 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
790 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
791 " There most likely is a bug somewhere: |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
792 " 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
|
793 " 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
|
794 norm! zc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
795 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
796 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
797 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
798 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
799 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
800 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
801 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
802 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
803 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
804 norm! Vjzc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
805 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
806 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
807 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
808 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
809 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
810 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
811 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
812 " Test for zC |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
813 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
814 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
815 norm! zCk |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
816 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
817 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
818 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
819 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
820 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
821 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
822 " Test for zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
823 " 1) close folds at line 49-54 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
824 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
825 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
826 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
827 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
828 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
829 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
830 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
831 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
832 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
833 " 2) do not close fold under curser |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
834 51 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
835 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
836 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
837 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
838 norm! 3k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
839 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
840 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
841 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
842 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
843 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
844 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
845 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
846 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
847 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
848 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
849 call assert_equal('53', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
850 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
851 call assert_equal('54/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
852 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
853 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
854 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
855 " 3) close one level of folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
856 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
857 set nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
858 set foldlevel=1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
859 norm! zx |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
860 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
861 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
862 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
863 call assert_equal('49/*{{{*/', 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('50/*{{{*/', 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('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
868 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
869 call assert_equal('53', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
870 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
871 call assert_equal('54/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
872 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
873 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
874 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
875 " Test for zX |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
876 " Close all folds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
877 set foldlevel=0 nofoldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
878 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
879 norm! zX |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
880 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
881 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
882 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
883 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
884 call assert_equal('49/*{{{*/', 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('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
887 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
888 " Test for zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
889 50 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
890 set nofoldenable foldlevel=2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
891 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
892 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
893 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
894 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
895 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
896 norm! zm |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
897 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
898 norm! k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
899 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
900 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
901 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
902 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
903 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
904 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
905 " Test for zM |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
906 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
907 set nofoldenable foldlevel=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
908 norm! zM |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
909 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
910 call assert_equal(0, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
911 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
912 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
913 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
914 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
915 call assert_equal('55', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
916 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
917 " Test for zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
918 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
919 set nofoldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
920 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
921 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
922 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
923 set foldlevel=0 foldenable |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
924 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
925 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
926 call assert_equal(1, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
927 norm! zr |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
928 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
929 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
930 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
931 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
932 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
933 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
934 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
935 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
936 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
937 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
938 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
939 " Test for zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
940 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
941 set nofoldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
942 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
943 call assert_equal(0, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
944 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
945 set foldenable foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
946 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
947 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
948 call assert_equal(2, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
949 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
950 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
951 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
952 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
953 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
954 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
955 call assert_equal('51/*}}}*/', 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('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
958 call append(50, ['a /*{{{*/', 'b /*}}}*/']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
959 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
960 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
961 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
962 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
963 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
964 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
965 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
966 call assert_equal('a /*{{{*/', getline('.')) |
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('51/*}}}*/', 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('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
971 48 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
972 norm! zR |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
973 call assert_equal(1, &foldenable) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
974 call assert_equal(3, &foldlevel) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
975 call assert_equal('48', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
976 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
977 call assert_equal('49/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
978 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
979 call assert_equal('50/*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
980 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
981 call assert_equal('a /*{{{*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
982 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
983 call assert_equal('b /*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
984 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
985 call assert_equal('51/*}}}*/', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
986 norm! j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
987 call assert_equal('52', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
988 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
989 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
990 setl nofoldenable fdm=marker foldlevel=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
991 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
992 endfu |
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 func! Test_normal19_z_spell() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
995 if !has("spell") || !has('syntax') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
996 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
997 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
998 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
999 call append(0, ['1 good', '2 goood', '3 goood']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1000 set spell spellfile=./Xspellfile.add spelllang=en |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1001 let oldlang=v:lang |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1002 lang C |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1003 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1004 " Test for zg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1005 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1006 norm! ]s |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1007 call assert_equal('2 goood', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1008 norm! zg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1009 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1010 let a=execute('unsilent :norm! ]s') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1011 call assert_equal('1 good', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1012 call assert_equal('search hit BOTTOM, continuing at TOP', a[1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1013 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1014 call assert_equal('goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1015 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1016 " Test for zw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1017 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1018 norm! $zw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1019 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1020 norm! ]s |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1021 call assert_equal('2 goood', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1022 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1023 call assert_equal('#oood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1024 call assert_equal('goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1025 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1026 " Test for zg in visual mode |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1027 let a=execute('unsilent :norm! V$zg') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1028 call assert_equal("Word '2 goood' added to ./Xspellfile.add", a[1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1029 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1030 norm! ]s |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1031 call assert_equal('3 goood', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1032 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1033 call assert_equal('2 goood', cnt[2]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1034 " Remove "2 good" from spellfile |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1035 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1036 let a=execute('unsilent norm! V$zw') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1037 call assert_equal("Word '2 goood' added to ./Xspellfile.add", a[1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1038 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1039 call assert_equal('2 goood/!', cnt[3]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1040 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1041 " Test for zG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1042 let a=execute('unsilent norm! V$zG') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1043 call assert_match("Word '2 goood' added to .*", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1044 let fname=matchstr(a, 'to\s\+\zs\f\+$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1045 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1046 call assert_equal('2 goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1047 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1048 " Test for zW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1049 let a=execute('unsilent norm! V$zW') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1050 call assert_match("Word '2 goood' added to .*", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1051 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1052 call assert_equal('# goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1053 call assert_equal('2 goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1054 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1055 " Test for zuW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1056 let a=execute('unsilent norm! V$zuW') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1057 call assert_match("Word '2 goood' removed from .*", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1058 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1059 call assert_equal('# goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1060 call assert_equal('# goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1061 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1062 " Test for zuG |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1063 let a=execute('unsilent norm! $zG') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1064 call assert_match("Word 'goood' added to .*", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1065 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1066 call assert_equal('# goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1067 call assert_equal('# goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1068 call assert_equal('goood', cnt[2]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1069 let a=execute('unsilent norm! $zuG') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1070 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1071 call assert_match("Word 'goood' removed from .*", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1072 call assert_equal('# goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1073 call assert_equal('# goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1074 call assert_equal('#oood', cnt[2]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1075 " word not found in wordlist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1076 let a=execute('unsilent norm! V$zuG') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1077 let cnt=readfile(fname) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1078 call assert_match("", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1079 call assert_equal('# goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1080 call assert_equal('# goood/!', cnt[1]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1081 call assert_equal('#oood', cnt[2]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1082 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1083 " Test for zug |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1084 call delete('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1085 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1086 let a=execute('unsilent norm! $zg') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1087 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1088 call assert_equal('goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1089 let a=execute('unsilent norm! $zug') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1090 call assert_match("Word 'goood' removed from \./Xspellfile.add", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1091 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1092 call assert_equal('#oood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1093 " word not in wordlist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1094 let a=execute('unsilent norm! V$zug') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1095 call assert_match('', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1096 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1097 call assert_equal('#oood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1098 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1099 " Test for zuw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1100 call delete('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1101 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1102 let a=execute('unsilent norm! Vzw') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1103 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1104 call assert_equal('2 goood/!', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1105 let a=execute('unsilent norm! Vzuw') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1106 call assert_match("Word '2 goood' removed from \./Xspellfile.add", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1107 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1108 call assert_equal('# goood/!', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1109 " word not in wordlist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1110 let a=execute('unsilent norm! $zug') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1111 call assert_match('', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1112 let cnt=readfile('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1113 call assert_equal('# goood/!', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1114 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1115 " add second entry to spellfile setting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1116 set spellfile=./Xspellfile.add,./Xspellfile2.add |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1117 call delete('./Xspellfile.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1118 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1119 let a=execute('unsilent norm! $2zg') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1120 let cnt=readfile('./Xspellfile2.add') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1121 call assert_match("Word 'goood' added to ./Xspellfile2.add", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1122 call assert_equal('goood', cnt[0]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1123 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1124 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1125 exe "lang" oldlang |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1126 call delete("./Xspellfile.add") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1127 call delete("./Xspellfile2.add") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1128 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1129 " zux -> no-op |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1130 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1131 norm! $zux |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1132 call assert_equal([], glob('Xspellfile.add',0,1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1133 call assert_equal([], glob('Xspellfile2.add',0,1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1134 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1135 set spellfile= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1136 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1137 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1138 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1139 func! Test_normal20_exmode() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1140 if !(has("win32") || has("win64")) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1141 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1142 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1143 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
|
1144 call writefile(['1', '2'], 'Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1145 call system(v:progpath .' -e -s < Xscript Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1146 let a=readfile('Xfile2') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1147 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
|
1148 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1149 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1150 for file in ['Xfile', 'Xfile2', 'Xscript'] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1151 call delete(file) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1152 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1153 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1154 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1155 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1156 func! Test_normal21_nv_hat() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1157 set hidden |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1158 e Xfoobar |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1159 e Xfile2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1160 call feedkeys("\<c-^>", 't') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1161 call assert_equal("Xfile2", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1162 call feedkeys("f\<c-^>", 't') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1163 call assert_equal("Xfile2", fnamemodify(bufname('%'), ':t')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1164 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1165 set nohidden |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1166 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1167 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1168 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1169 func! Test_normal22_zet() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1170 " Test for ZZ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1171 let shell = &shell |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1172 let &shell = 'sh' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1173 call writefile(['1', '2'], 'Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1174 let args = ' -u NONE -N -U NONE -i NONE --noplugins -X --not-a-term' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1175 call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1176 let a = readfile('Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1177 call assert_equal([], a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1178 " Test for ZQ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1179 call writefile(['1', '2'], 'Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1180 call system(v:progpath . args . ' -c "%d" -c ":norm! ZQ" Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1181 let a = readfile('Xfile') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1182 call assert_equal(['1', '2'], a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1183 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1184 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1185 for file in ['Xfile'] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1186 call delete(file) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1187 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1188 let &shell = shell |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1189 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1190 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1191 func! Test_normal23_K() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1192 " Test for K command |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1193 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1194 call append(0, ['version8.txt', 'man']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1195 let k = &keywordprg |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1196 set keywordprg=:help |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1197 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1198 norm! VK |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1199 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
|
1200 call assert_equal('help', &ft) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1201 call assert_match('\*version8.txt\*', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1202 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1203 norm! 0K |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1204 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
|
1205 call assert_equal('help', &ft) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1206 call assert_match('\*version8\.0\*', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1207 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1208 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1209 if !(has("win32") || has("win64")) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1210 let &keywordprg = k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1211 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1212 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1213 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1214 set keywordprg=man\ --pager=cat |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1215 " Test for using man |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1216 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1217 let a = execute('unsilent norm! K') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1218 call assert_match("man --pager=cat 'man'", a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1219 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1220 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1221 let &keywordprg = k |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1222 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1223 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1224 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1225 func! Test_normal24_rot13() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1226 " This test uses multi byte characters |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1227 if !has("multi_byte") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1228 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1229 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1230 " Testing for g?? g?g? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1231 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1232 call append(0, 'abcdefghijklmnopqrstuvwxyzäüö') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1233 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1234 norm! g?? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1235 call assert_equal('nopqrstuvwxyzabcdefghijklmäüö', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1236 norm! g?g? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1237 call assert_equal('abcdefghijklmnopqrstuvwxyzäüö', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1238 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1239 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1240 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1241 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1242 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1243 func! Test_normal25_tag() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1244 " Testing for CTRL-] g CTRL-] g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1245 " 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
|
1246 h |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1247 " Test for CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1248 call search('\<x\>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1249 exe "norm! \<c-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1250 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
|
1251 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1252 call assert_equal("*x*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1253 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1254 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1255 " Test for g_CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1256 call search('\<v_u\>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1257 exe "norm! g\<c-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1258 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
|
1259 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1260 call assert_equal("*v_u*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1261 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1262 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1263 " Test for g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1264 call search('\<i_<Esc>$') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1265 let a = execute(":norm! g]") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1266 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
|
1267 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1268 if !empty(exepath('cscope')) && has('cscope') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1269 " setting cscopetag changes how g] works |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1270 set cst |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1271 exe "norm! g]" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1272 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
|
1273 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1274 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1275 exe ":norm \<c-o>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1276 " Test for CTRL-W g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1277 exe "norm! \<C-W>g]" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1278 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
|
1279 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1280 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1281 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1282 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1283 set nocst |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1284 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1285 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1286 " Test for CTRL-W g] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1287 let a = execute("norm! \<C-W>g]") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1288 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
|
1289 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1290 " Test for CTRL-W CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1291 exe "norm! \<C-W>\<C-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1292 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
|
1293 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1294 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1295 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1296 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1297 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1298 " Test for CTRL-W g CTRL-] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1299 exe "norm! \<C-W>g\<C-]>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1300 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
|
1301 norm! yiW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1302 call assert_equal("*i_<Esc>*", @0) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1303 call assert_equal(3, winnr('$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1304 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1305 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1306 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1307 helpclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1308 endfu |
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 func! Test_normal26_put() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1311 " Test for ]p ]P [p and [P |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1312 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1313 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
|
1314 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1315 /Error/y a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1316 2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1317 norm! "a]pj"a[p |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1318 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
|
1319 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1320 /^\s\{4}/ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1321 exe "norm! \"a]P3Eldt'" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1322 exe "norm! j\"a[P2Eldt'" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1323 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
|
1324 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1325 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1326 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1327 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1328 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1329 func! Test_normal27_bracket() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1330 " Test for [' [` ]' ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1331 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1332 1,21s/.\+/ & b/ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1333 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1334 norm! $ma |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1335 5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1336 norm! $mb |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1337 10 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1338 norm! $mc |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1339 15 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1340 norm! $md |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1341 20 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1342 norm! $me |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1343 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1344 " Test for [' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1345 9 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1346 norm! 2[' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1347 call assert_equal(' 1 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1348 call assert_equal(1, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1349 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1350 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1351 " Test for ]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1352 norm! ]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1353 call assert_equal(' 5 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1354 call assert_equal(5, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1355 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1356 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1357 " 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
|
1358 21 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1359 norm! $]' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1360 call assert_equal(' 21 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1361 call assert_equal(21, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1362 call assert_equal(3, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1363 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1364 " Test for [` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1365 norm! 2[` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1366 call assert_equal(' 15 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1367 call assert_equal(15, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1368 call assert_equal(8, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1369 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1370 " Test for ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1371 norm! ]` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1372 call assert_equal(' 20 b', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1373 call assert_equal(20, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1374 call assert_equal(8, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1375 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1376 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1377 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1378 endfu |
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 func! Test_normal28_parenthesis() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1381 " basic testing for ( and ) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1382 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1383 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
|
1384 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1385 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1386 norm! d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1387 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
|
1388 norm! 2d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1389 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
|
1390 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1391 norm! 0d) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1392 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
|
1393 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1394 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
|
1395 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1396 norm! $d( |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1397 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
|
1398 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1399 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1400 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1401 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1402 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1403 fun! Test_normal29_brace() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1404 " basic test for { and } movements |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1405 let text= ['A paragraph begins after each empty line, and also at each of a set of', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1406 \ 'paragraph macros, specified by the pairs of characters in the ''paragraphs''', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1407 \ 'option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1408 \ 'the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1409 \ 'the first column). A section boundary is also a paragraph boundary.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1410 \ 'Note that a blank line (only containing white space) is NOT a paragraph', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1411 \ 'boundary.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1412 \ '', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1413 \ '', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1414 \ 'Also note that this does not include a ''{'' or ''}'' in the first column. When', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1415 \ 'the ''{'' flag is in ''cpoptions'' then ''{'' in the first column is used as a', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1416 \ 'paragraph boundary |posix|.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1417 \ '{', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1418 \ 'This is no paragaraph', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1419 \ 'unless the ''{'' is set', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1420 \ 'in ''cpoptions''', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1421 \ '}', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1422 \ '.IP', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1423 \ 'The nroff macros IP seperates a paragraph', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1424 \ 'That means, it must be a ''.''', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1425 \ 'followed by IP', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1426 \ '.LPIt does not matter, if afterwards some', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1427 \ 'more characters follow.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1428 \ '.SHAlso section boundaries from the nroff', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1429 \ 'macros terminate a paragraph. That means', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1430 \ 'a character like this:', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1431 \ '.NH', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1432 \ 'End of text here'] |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1433 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1434 call append(0, text) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1435 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1436 norm! 0d2} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1437 call assert_equal(['.IP', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1438 \ 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''', 'followed by IP', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1439 \ '.LPIt does not matter, if afterwards some', 'more characters follow.', '.SHAlso section boundaries from the nroff', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1440 \ 'macros terminate a paragraph. That means', 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1441 norm! 0d} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1442 call assert_equal(['.LPIt does not matter, if afterwards some', 'more characters follow.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1443 \ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1444 \ 'a character like this:', '.NH', 'End of text here', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1445 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1446 norm! d{ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1447 call assert_equal(['.LPIt does not matter, if afterwards some', 'more characters follow.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1448 \ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means', 'a character like this:', ''], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1449 norm! d{ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1450 call assert_equal(['.LPIt does not matter, if afterwards some', 'more characters follow.', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1451 " Test with { in cpooptions |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1452 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1453 call append(0, text) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1454 set cpo+={ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1455 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1456 norm! 0d2} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1457 call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1458 \ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1459 \ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1460 \ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1461 \ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1462 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1463 norm! d} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1464 call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1465 \ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1466 \ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1467 \ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means', |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1468 \ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1469 norm! gg} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1470 norm! d5} |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1471 call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1472 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1473 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1474 set cpo-={ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1475 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1476 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1477 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1478 fun! Test_normal30_changecase() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1479 " This test uses multi byte characters |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1480 if !has("multi_byte") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1481 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1482 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1483 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1484 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
|
1485 norm! 1ggVu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1486 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
|
1487 norm! VU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1488 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
|
1489 norm! guu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1490 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
|
1491 norm! gUgU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1492 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
|
1493 norm! gugu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1494 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
|
1495 norm! gUU |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1496 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
|
1497 norm! 010~ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1498 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
|
1499 norm! V~ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1500 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
|
1501 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1502 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1503 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1504 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1505 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1506 fun! Test_normal31_r_cmd() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1507 " Test for r command |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1508 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1509 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
|
1510 exe "norm! 1gg$r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1511 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
|
1512 exe "norm! 1gg2wlr\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1513 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
|
1514 exe "norm! 2gg0W5r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1515 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
|
1516 set autoindent |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1517 call setline(2, ['simple test: abc', '']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1518 exe "norm! 2gg0W5r\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1519 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
|
1520 exe "norm! 1ggVr\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1521 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
|
1522 call setline(1, 'This is a') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1523 exe "norm! 1gg05rf" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1524 call assert_equal('fffffis a', getline(1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1525 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1526 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1527 set noautoindent |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1528 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1529 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1530 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1531 func! Test_normal32_g_cmd1() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1532 " Test for g*, g# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1533 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1534 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
|
1535 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1536 norm! $g* |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1537 call assert_equal('x_foo', @/) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1538 call assert_equal('x_foobar.abc', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1539 norm! $g# |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1540 call assert_equal('abc', @/) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1541 call assert_equal('abc.x_foo', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1542 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1543 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1544 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1545 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1546 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1547 fun! Test_normal33_g_cmd2() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1548 if !has("jumplist") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1549 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1550 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1551 " Tests for g cmds |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1552 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1553 " Test for g` |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1554 clearjumps |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1555 norm! ma10j |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1556 let a=execute(':jumps') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1557 " empty jumplist |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1558 call assert_equal('>', a[-1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1559 norm! g`a |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1560 call assert_equal('>', a[-1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1561 call assert_equal(1, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1562 call assert_equal('1', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1563 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1564 " Test for g; and g, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1565 norm! g; |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1566 " 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
|
1567 " currently, when we setup the window |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1568 call assert_equal(2, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1569 call assert_fails(':norm! g;', 'E662') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1570 call assert_fails(':norm! g,', 'E663') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1571 let &ul=&ul |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1572 call append('$', ['a', 'b', 'c', 'd']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1573 let &ul=&ul |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1574 call append('$', ['Z', 'Y', 'X', 'W']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1575 let a = execute(':changes') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1576 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
|
1577 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
|
1578 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
|
1579 norm! 3g; |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1580 call assert_equal(2, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1581 norm! 2g, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1582 call assert_equal(105, line('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1583 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1584 " Test for g& - global substitute |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1585 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1586 call setline(1, range(1,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1587 call append('$', ['a', 'b', 'c', 'd']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1588 $s/\w/&&/g |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1589 exe "norm! /[1-8]\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1590 norm! g& |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1591 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
|
1592 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1593 " Test for gv |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1594 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1595 call append('$', repeat(['abcdefgh'], 8)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1596 exe "norm! 2gg02l\<c-v>2j2ly" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1597 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
|
1598 " 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
|
1599 exe "norm! G0\<c-v>4k4lgvd" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1600 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
|
1601 exe "norm! G0\<c-v>4k4ly" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1602 exe "norm! gvood" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1603 call assert_equal(['', 'abfgh', 'abfgh', 'abfgh', 'fgh', 'fgh', 'fgh', 'fgh', 'fgh'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1604 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1605 " Test for gk/gj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1606 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1607 15vsp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1608 set wrap listchars= sbr= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1609 let lineA='abcdefghijklmnopqrstuvwxyz' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1610 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1611 $put =lineA |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1612 $put =lineB |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1613 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1614 norm! 3gg0dgk |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1615 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1616 set nu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1617 norm! 3gg0gjdgj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1618 call assert_equal(['', 'abcdefghijklmno', '0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1619 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1620 " Test for gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1621 norm! 2gggJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1622 call assert_equal(['', 'abcdefghijklmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1623 call assert_equal(16, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1624 " shouldn't do anything |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1625 norm! 10gJ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1626 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1627 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1628 " Test for g0 g^ gm g$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1629 exe "norm! 2gg0gji " |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1630 call assert_equal(['', 'abcdefghijk lmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1631 norm! g0yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1632 call assert_equal(12, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1633 call assert_equal(' ', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1634 norm! g$yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1635 call assert_equal(22, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1636 call assert_equal('3', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1637 norm! gmyl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1638 call assert_equal(17, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1639 call assert_equal('n', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1640 norm! g^yl |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1641 call assert_equal(15, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1642 call assert_equal('l', getreg(0)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1643 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1644 " Test for g Ctrl-G |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1645 let a=execute(":norm! g\<c-g>") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1646 call assert_match('Col 15 of 43; Line 2 of 2; Word 2 of 2; Byte 16 of 45', a) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1647 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1648 " Test for gI |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1649 norm! gIfoo |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1650 call assert_equal(['', 'fooabcdefghijk lmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1651 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1652 " Test for gi |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1653 wincmd c |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1654 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1655 set tw=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1656 call setline(1, ['foobar', 'new line']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1657 norm! A next word |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1658 $put ='third line' |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1659 norm! gi another word |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1660 call assert_equal(['foobar next word another word', 'new line', 'third line'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1661 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1662 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1663 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1664 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1665 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1666 fun! Test_normal34_g_cmd3() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1667 if !has("multi_byte") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1668 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1669 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1670 " Test for g8 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1671 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1672 call append(0, 'abcdefghijklmnopqrstuvwxyzäüö') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1673 let a=execute(':norm! 1gg$g8') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1674 call assert_equal('c3 b6 ', a[1:]) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1675 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1676 " Test for gp gP |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1677 call append(1, range(1,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1678 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1679 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1680 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1681 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1682 fun! Test_normal35_g_cmd4() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1683 " Test for g< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1684 " Cannot capture its output, |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1685 " probably a bug, therefore, test disabled: |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1686 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1687 echo "a\nb\nc\nd" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1688 let b=execute(':norm! g<') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1689 call assert_true(!empty(b), 'failed `execute(g<)`') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1690 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1691 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1692 fun! Test_normal36_g_cmd5() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1693 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1694 call append(0, 'abcdefghijklmnopqrstuvwxyz') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1695 " Test for gp gP |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1696 call append(1, range(1,10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1697 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1698 norm! 1yy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1699 3 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1700 norm! gp |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1701 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
|
1702 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1703 norm! gP |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1704 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
|
1705 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1706 " Test for go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1707 norm! 26go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1708 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
|
1709 norm! 27go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1710 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
|
1711 norm! 28go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1712 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
|
1713 set ff=dos |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1714 norm! 29go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1715 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
|
1716 set ff=unix |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1717 norm! gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1718 norm! 101go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1719 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
|
1720 norm! 103go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1721 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
|
1722 " count > buffer content |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1723 norm! 120go |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1724 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
|
1725 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1726 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1727 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1728 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1729 fun! Test_normal37_g_cmd6() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1730 " basic test for gt and gT |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1731 tabnew 1.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1732 tabnew 2.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1733 tabnew 3.txt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1734 norm! 1gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1735 call assert_equal(1, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1736 norm! 3gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1737 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1738 norm! 1gT |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1739 " 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
|
1740 " 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
|
1741 call assert_equal(2, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1742 " wrap around |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1743 norm! 3gT |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1744 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1745 " gt does not wrap around |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1746 norm! 5gt |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1747 call assert_equal(3, tabpagenr()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1748 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1749 for i in range(3) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1750 tabclose |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1751 endfor |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1752 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1753 call assert_fails(':tabclose', 'E784') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1754 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1755 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1756 fun! Test_normal38_nvhome() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1757 " Test for <Home> and <C-Home> key |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1758 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1759 call setline(1, range(10)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1760 $ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1761 setl et sw=2 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1762 norm! V10>$ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1763 " count is ignored |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1764 exe "norm! 10\<home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1765 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1766 exe "norm! \<home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1767 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
|
1768 exe "norm! 5\<c-home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1769 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
|
1770 exe "norm! \<c-home>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1771 call assert_equal([0, 1, 1, 0, 1], getcurpos()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1772 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1773 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1774 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1775 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1776 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1777 fun! Test_normal39_cw() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1778 " Test for cw and cW on whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1779 " and cpo+=w setting |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1780 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1781 set tw=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1782 call append(0, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1783 norm! 1gg0elcwZZZ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1784 call assert_equal('hereZZZare some words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1785 norm! 1gg0elcWYYY |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1786 call assert_equal('hereZZZareYYYsome words', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1787 set cpo+=w |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1788 call setline(1, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1789 norm! 1gg0elcwZZZ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1790 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
|
1791 norm! 1gg2elcWYYY |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1792 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
|
1793 set cpo-=w |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1794 norm! 2gg0cwfoo |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1795 call assert_equal('foo', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1796 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1797 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1798 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1799 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1800 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1801 fun! Test_normal40_ctrl_bsl() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1802 " Basic test for CTRL-\ commands |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1803 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1804 call append(0, 'here are some words') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1805 exe "norm! 1gg0a\<C-\>\<C-N>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1806 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1807 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1808 call assert_equal('', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1809 exe "norm! 1gg0viw\<C-\>\<C-N>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1810 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1811 call assert_equal(4, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1812 exe "norm! 1gg0a\<C-\>\<C-G>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1813 call assert_equal('n', mode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1814 call assert_equal(1, col('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1815 "imap <buffer> , <c-\><c-n> |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1816 set im |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1817 exe ":norm! \<c-\>\<c-n>dw" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1818 set noim |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1819 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
|
1820 call assert_false(&insertmode) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1821 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1822 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1823 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1824 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1825 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1826 fun! Test_normal41_insert_reg() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1827 " Test for <c-r>=, <c-r><c-r>= and <c-r><c-o>= |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1828 " in insert mode |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1829 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1830 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
|
1831 call append(0, ["aaa\tbbb\tccc", '', '', '']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1832 let a=getline(1) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1833 norm! 2gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1834 exe "norm! a\<c-r>=a\<cr>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1835 norm! 3gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1836 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
|
1837 norm! 4gg0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1838 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
|
1839 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
|
1840 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1841 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1842 set sts=0 sw=8 ts=8 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1843 "bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1844 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1845 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1846 func! Test_normal42_halfpage() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1847 " basic test for Ctrl-D and Ctrl-U |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1848 call Setup_NewWindow() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1849 call assert_equal(5, &scroll) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1850 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1851 call assert_equal('6', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1852 exe "norm! 2\<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1853 call assert_equal('8', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1854 call assert_equal(2, &scroll) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1855 set scroll=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1856 exe "norm! \<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1857 call assert_equal('3', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1858 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1859 set scrolloff=5 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1860 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1861 call assert_equal('10', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1862 exe "norm! \<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1863 call assert_equal('5', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1864 1 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1865 set scrolloff=99 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1866 exe "norm! \<c-d>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1867 call assert_equal('10', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1868 set scrolloff=0 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1869 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1870 exe "norm! $\<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1871 call assert_equal('95', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1872 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
|
1873 100 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1874 set nostartofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1875 exe "norm! $\<c-u>" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1876 call assert_equal('95', getline('.')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1877 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
|
1878 " cleanup |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1879 set startofline |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1880 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1881 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1882 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1883 fun! Test_normal43_textobject1() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1884 " basic tests for text object aw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1885 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1886 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
|
1887 " diw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1888 norm! 1gg0diw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1889 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
|
1890 " daw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1891 norm! 2ggEdaw |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1892 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
|
1893 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1894 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
|
1895 " diW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1896 norm! 2ggwd2iW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1897 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
|
1898 " daW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1899 norm! 1ggd2aW |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1900 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
|
1901 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1902 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1903 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
|
1904 " 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
|
1905 norm! 2gg$Vawd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1906 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
|
1907 norm! 1gg$Viwd |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1908 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
|
1909 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1910 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1911 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1912 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1913 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1914 func! Test_normal44_textobjects2() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1915 " basic testing for is and as text objects |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1916 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1917 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
|
1918 " 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
|
1919 norm! 1gg0dis |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1920 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
|
1921 " Test for das - removes leading whitespace |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1922 norm! 3ggf?ldas |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1923 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
|
1924 " 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
|
1925 norm! 3gg$Visy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1926 call assert_equal('v', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1927 " reset visualmode() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1928 norm! 3ggVy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1929 norm! 3gg$Vasy |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1930 call assert_equal('v', visualmode()) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1931 " basic testing for textobjects a< and at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1932 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1933 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
|
1934 " a< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1935 norm! 1gg0da< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1936 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
|
1937 norm! 1pj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1938 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
|
1939 " at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1940 norm! d2at |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1941 call assert_equal([' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1942 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1943 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
|
1944 " i< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1945 norm! 1gg0di< |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1946 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
|
1947 norm! 1Pj |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1948 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
|
1949 norm! d2it |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1950 call assert_equal(['<div></div>',' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1951 " 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
|
1952 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1953 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1954 norm! 3gg0di[ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1955 call assert_equal([' ', '[', ']'], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1956 call setline(1, [' ', '[', 'one [two]', 'thre', ']']) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1957 norm! 3gg0ftd2a[ |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1958 call assert_equal([' '], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1959 %d |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1960 " 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
|
1961 call append(0, 'foo "bar"') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1962 norm! 1gg0di" |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1963 call assert_equal(['foo ""', ''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1964 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1965 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1966 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1967 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1968 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1969 func! Test_normal45_drop() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1970 if !has("dnd") |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1971 return |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1972 endif |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1973 " basic test for :drop command |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1974 " 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
|
1975 " 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
|
1976 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1977 call assert_fails(':norm! "~p', 'E353') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1978 call assert_equal([], getreg('~', 1, 1)) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1979 " the ~ register is read only |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1980 call assert_fails(':let @~="1"', 'E354') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1981 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1982 endfu |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1983 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1984 func! Test_normal46_ignore() |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1985 new |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1986 " How to test this? |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1987 " 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
|
1988 " does not change |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1989 call feedkeys("\<c-s>", 't') |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1990 call assert_equal([''], getline(1,'$')) |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1991 |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1992 " clean up |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1993 bw! |
5337340beea0
commit https://github.com/vim/vim/commit/87bc3f74598ae8c648957e5755000cc6cdbc89ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1994 endfu |