Mercurial > vim
annotate src/testdir/test_tabpage.vim @ 11050:622ed5a4925f v8.0.0414
patch 8.0.0414: balloon eval is not tested
commit https://github.com/vim/vim/commit/d5841f28d4b041830af0f3314979f9b9093d1a77
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 5 13:27:25 2017 +0100
patch 8.0.0414: balloon eval is not tested
Problem: Balloon eval is not tested.
Solution: Add a few balloon tests. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 05 Mar 2017 13:30:04 +0100 |
parents | 380e706814da |
children | 70bc7b107610 |
rev | line source |
---|---|
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for tabpage |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 function Test_tabpage() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 bw! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 " Simple test for opening and closing a tab page |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call assert_equal(2, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 quit |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " Open three tab pages and use ":tabdo" |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 0tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 1tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 $tabnew |
10270
e5dddd764fef
commit https://github.com/vim/vim/commit/3e8474dd50f64c998bb665ce852f584a58dede6b
Christian Brabandt <cb@256bit.org>
parents:
10136
diff
changeset
|
14 %del |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 tabdo call append(line('$'), tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 tabclose! 2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 tabrewind |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 let line1 = getline('$') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 undo |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 q |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 tablast |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 let line2 = getline('$') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 q! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call append(line('$'), line1) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call append(line('$'), line2) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 unlet line1 line2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal(['', '3', '1', '4'], getline(1, '$')) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 " Test for settabvar() and gettabvar() functions. Open a new tab page and |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " set 3 variables to a number, string and a list. Verify that the variables |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " are correctly set. |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 tabfirst |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call settabvar(2, 'val_num', 100) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call settabvar(2, 'val_str', 'SetTabVar test') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call settabvar(2, 'val_list', ['red', 'blue', 'green']) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 call assert_true(gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test' && gettabvar(2, 'val_list') == ['red', 'blue', 'green']) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 tabnext 2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call assert_true(t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green']) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 tabclose |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 if has('gui') || has('clientserver') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 " Test for ":tab drop exist-file" to keep current window. |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 sp test1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 tab drop test1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 close |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 " Test for ":tab drop new-file" to keep current window of tabpage 1. |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 split |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 tab drop newfile |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 tabclose |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 q |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 " Test for ":tab drop multi-opend-file" to keep current tabpage and window. |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 new test1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 new test1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 tab drop test1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 tabclose |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 q |
10432
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
68 " |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
69 " |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
70 " Test for ":tab drop vertical-split-window" to jump test1 buffer |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
71 tabedit test1 |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
72 vnew |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
73 tabfirst |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
74 tab drop test1 |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
75 call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)]) |
262f5bc3d38e
commit https://github.com/vim/vim/commit/5a030a540f4157d5c9905e3564282c92b4dcec9a
Christian Brabandt <cb@256bit.org>
parents:
10270
diff
changeset
|
76 1tabonly |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 endif |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 for i in range(9) | tabnew | endfor |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 normal! 1gt |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 tabmove 5 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 .tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 tabmove - |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 call assert_equal(4, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 tabmove + |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 tabmove -2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call assert_equal(3, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 tabmove +4 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 call assert_equal(7, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 0tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 $tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 tabmove 0 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 tabmove $ |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 3tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 call assert_equal(4, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 7tabmove 5 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 call assert_equal(5, tabpagenr()) |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
109 call assert_fails("99tabmove", 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
110 call assert_fails("+99tabmove", 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
111 call assert_fails("-99tabmove", 'E16:') |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 call assert_fails("tabmove foo", 'E474:') |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
113 call assert_fails("tabmove 99", 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
114 call assert_fails("tabmove +99", 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
115 call assert_fails("tabmove -99", 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
116 call assert_fails("tabmove -3+", 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
117 call assert_fails("tabmove $3", 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
118 1tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 endfunc |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 " Test autocommands |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 function Test_tabpage_with_autocmd() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 if !has('autocmd') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 return |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 endif |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 command -nargs=1 -bar C :call add(s:li, '=== ' . <q-args> . ' ===')|<args> |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 augroup TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 au! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 autocmd TabEnter * call add(s:li, 'TabEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 autocmd WinEnter * call add(s:li, 'WinEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 autocmd BufEnter * call add(s:li, 'BufEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 autocmd TabLeave * call add(s:li, 'TabLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 autocmd WinLeave * call add(s:li, 'WinLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 autocmd BufLeave * call add(s:li, 'BufLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 let t:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 C tab split |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 call assert_equal(['=== tab split ===', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 let t:a='b' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 call assert_equal(['=== tabnew ===', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufLeave', 'BufEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 let t:a='c' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 let s:li = split(join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")')) , '\s\+') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 call assert_equal(['a', 'b', 'c'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 C call map(range(1, tabpagenr('$')), 'settabvar(v:val, ''a'', v:val*2)') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 call assert_equal(["=== call map(range(1, tabpagenr('$')), 'settabvar(v:val, ''a'', v:val*2)') ==="], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 let s:li = split(join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")')) , '\s\+') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call assert_equal(['2', '4', '6'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 C vsplit |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 call assert_equal(['=== vsplit ===', 'WinLeave', 'WinEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 let tabn=tabpagenr() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 let winr=range(1, winnr('$')) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call assert_equal(['=== tabnext 1 ===', 'BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 let s:li = split(join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")')), '\s\+') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call assert_equal(['a', 'a'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 C call map(copy(winr), 'settabwinvar('.tabn.', v:val, ''a'', v:val*2)') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 let s:li = split(join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")')), '\s\+') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 call assert_equal(['2', '4'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 augroup TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 autocmd TabEnter * :C tabnext 2 | C tabclose 3 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 C tabnext 3 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 call assert_equal(['=== tabnext 3 ===', 'BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', '=== tabnext 2 ===', '=== tabclose 3 ==='], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 autocmd! TabDestructive TabEnter |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 call assert_equal(['=== tabnew ===', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufLeave', 'BufEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 call assert_equal(['=== tabnext 1 ===', 'BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 autocmd TabDestructive TabEnter * nested :C tabnext 2 | C tabclose 3 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 let s:li = [] |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
190 call assert_equal(3, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
191 C tabnext 2 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
192 call assert_equal(2, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
193 call assert_equal(['=== tabnext 2 ===', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', '=== tabnext 2 ===', '=== tabclose 3 ==='], s:li) |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 delcommand C |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 autocmd! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 augroup! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 autocmd! TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 augroup! TestTabpageGroup |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
201 1tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 endfunction |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
204 function Test_tabpage_with_tab_modifier() |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
205 for n in range(4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
206 tabedit |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
207 endfor |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
208 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
209 function s:check_tab(pre_nr, cmd, post_nr) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
210 exec 'tabnext ' . a:pre_nr |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
211 exec a:cmd |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
212 call assert_equal(a:post_nr, tabpagenr()) |
10136
13304dccb96e
commit https://github.com/vim/vim/commit/100f5c90f4d4fb40bc3aeabc35192db371f5988f
Christian Brabandt <cb@256bit.org>
parents:
10082
diff
changeset
|
213 call assert_equal('help', &buftype) |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
214 helpclose |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
215 endfunc |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
216 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
217 call s:check_tab(1, 'tab help', 2) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
218 call s:check_tab(1, '3tab help', 4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
219 call s:check_tab(1, '.tab help', 2) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
220 call s:check_tab(1, '.+1tab help', 3) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
221 call s:check_tab(1, '0tab help', 1) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
222 call s:check_tab(2, '+tab help', 4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
223 call s:check_tab(2, '+2tab help', 5) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
224 call s:check_tab(4, '-tab help', 4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
225 call s:check_tab(4, '-2tab help', 3) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
226 call s:check_tab(3, '$tab help', 6) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
227 call assert_fails('99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
228 call assert_fails('+99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
229 call assert_fails('-99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
230 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
231 delfunction s:check_tab |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
232 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
233 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
234 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
235 function Check_tab_count(pre_nr, cmd, post_nr) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
236 exec 'tabnext' a:pre_nr |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
237 normal! G |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
238 exec a:cmd |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
239 call assert_equal(a:post_nr, tabpagenr(), a:cmd) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
240 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
241 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
242 " Test for [count] of tabnext |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
243 function Test_tabpage_with_tabnext() |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
244 for n in range(4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
245 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
246 call setline(1, ['', '', '3']) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
247 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
248 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
249 call Check_tab_count(1, 'tabnext', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
250 call Check_tab_count(1, '3tabnext', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
251 call Check_tab_count(1, '.tabnext', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
252 call Check_tab_count(1, '.+1tabnext', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
253 call Check_tab_count(2, '+tabnext', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
254 call Check_tab_count(2, '+2tabnext', 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
255 call Check_tab_count(4, '-tabnext', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
256 call Check_tab_count(4, '-2tabnext', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
257 call Check_tab_count(3, '$tabnext', 5) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
258 call assert_fails('0tabnext', 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
259 call assert_fails('99tabnext', 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
260 call assert_fails('+99tabnext', 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
261 call assert_fails('-99tabnext', 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
262 call Check_tab_count(1, 'tabnext 3', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
263 call Check_tab_count(2, 'tabnext +', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
264 call Check_tab_count(2, 'tabnext +2', 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
265 call Check_tab_count(4, 'tabnext -', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
266 call Check_tab_count(4, 'tabnext -2', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
267 call Check_tab_count(3, 'tabnext $', 5) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
268 call assert_fails('tabnext 0', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
269 call assert_fails('tabnext .', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
270 call assert_fails('tabnext -+', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
271 call assert_fails('tabnext +2-', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
272 call assert_fails('tabnext $3', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
273 call assert_fails('tabnext 99', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
274 call assert_fails('tabnext +99', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
275 call assert_fails('tabnext -99', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
276 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
277 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
278 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
279 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
280 " Test for [count] of tabprevious |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
281 function Test_tabpage_with_tabprevious() |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
282 for n in range(5) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
283 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
284 call setline(1, ['', '', '3']) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
285 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
286 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
287 for cmd in ['tabNext', 'tabprevious'] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
288 call Check_tab_count(6, cmd, 5) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
289 call Check_tab_count(6, '3' . cmd, 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
290 call Check_tab_count(6, '8' . cmd, 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
291 call Check_tab_count(6, cmd . ' 3', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
292 call Check_tab_count(6, cmd . ' 8', 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
293 for n in range(2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
294 for c in ['0', '.+3', '+', '+2' , '-', '-2' , '$', '+99', '-99'] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
295 if n == 0 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
296 let entire_cmd = c . cmd |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
297 let err_code = 'E16:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
298 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
299 let entire_cmd = cmd . ' ' . c |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
300 let err_code = 'E474:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
301 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
302 call assert_fails(entire_cmd, err_code) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
303 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
304 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
305 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
306 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
307 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
308 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
309 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
310 function s:reconstruct_tabpage_for_test(nr) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
311 let n = (a:nr > 2) ? a:nr - 2 : 1 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
312 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
313 0tabedit n0 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
314 for n in range(1, n) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
315 exec '$tabedit n' . n |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
316 if n == 1 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
317 call setline(1, ['', '', '3']) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
318 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
319 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
320 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
321 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
322 " Test for [count] of tabclose |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
323 function Test_tabpage_with_tabclose() |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
324 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
325 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
326 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
327 call Check_tab_count(3, 'tabclose!', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
328 call Check_tab_count(1, '3tabclose', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
329 call Check_tab_count(4, '4tabclose', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
330 call Check_tab_count(3, '1tabclose', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
331 call Check_tab_count(2, 'tabclose', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
332 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
333 call assert_equal('', bufname('')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
334 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
335 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
336 call Check_tab_count(2, '$tabclose', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
337 call Check_tab_count(4, '.tabclose', 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
338 call Check_tab_count(3, '.+tabclose', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
339 call Check_tab_count(3, '.-2tabclose', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
340 call Check_tab_count(1, '.+1tabclose!', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
341 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
342 call assert_equal('', bufname('')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
343 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
344 " post count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
345 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
346 call Check_tab_count(3, 'tabclose!', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
347 call Check_tab_count(1, 'tabclose 3', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
348 call Check_tab_count(4, 'tabclose 4', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
349 call Check_tab_count(3, 'tabclose 1', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
350 call Check_tab_count(2, 'tabclose', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
351 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
352 call assert_equal('', bufname('')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
353 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
354 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
355 call Check_tab_count(2, 'tabclose $', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
356 call Check_tab_count(4, 'tabclose', 4) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
357 call Check_tab_count(3, 'tabclose +', 3) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
358 call Check_tab_count(3, 'tabclose -2', 2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
359 call Check_tab_count(1, 'tabclose! +1', 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
360 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
361 call assert_equal('', bufname('')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
362 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
363 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
364 for n in range(2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
365 for c in ['0', '$3', '99', '+99', '-99'] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
366 if n == 0 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
367 let entire_cmd = c . 'tabclose' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
368 let err_code = 'E16:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
369 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
370 let entire_cmd = 'tabclose ' . c |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
371 let err_code = 'E474:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
372 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
373 call assert_fails(entire_cmd, err_code) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
374 call assert_equal(6, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
375 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
376 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
377 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
378 call assert_fails('3tabclose', 'E37:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
379 call assert_fails('tabclose 3', 'E37:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
380 call assert_fails('tabclose -+', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
381 call assert_fails('tabclose +2-', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
382 call assert_equal(6, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
383 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
384 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
385 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
386 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
387 " Test for [count] of tabonly |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
388 function Test_tabpage_with_tabonly() |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
389 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
390 " Test for the normal behavior (pre count only) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
391 let tc = [ [4, '.', '!'], [2, '.+', ''], [3, '.-2', '!'], [1, '.+1', '!'] ] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
392 for c in tc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
393 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
394 let entire_cmd = c[1] . 'tabonly' . c[2] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
395 call Check_tab_count(c[0], entire_cmd, 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
396 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
397 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
398 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
399 " Test for the normal behavior |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
400 let tc2 = [ [3, '', ''], [1, '3', ''], [4, '4', '!'], [3, '1', '!'], |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
401 \ [2, '', '!'], |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
402 \ [2, '$', '!'], [3, '+', '!'], [3, '-2', '!'], [3, '+1', '!'] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
403 \ ] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
404 for n in range(2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
405 for c in tc2 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
406 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
407 if n == 0 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
408 let entire_cmd = c[1] . 'tabonly' . c[2] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
409 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
410 let entire_cmd = 'tabonly' . c[2] . ' ' . c[1] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
411 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
412 call Check_tab_count(c[0], entire_cmd, 1) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
413 call assert_equal(1, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
414 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
415 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
416 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
417 " Test for the error behavior |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
418 for n in range(2) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
419 for c in ['0', '$3', '99', '+99', '-99'] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
420 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
421 if n == 0 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
422 let entire_cmd = c . 'tabonly' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
423 let err_code = 'E16:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
424 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
425 let entire_cmd = 'tabonly ' . c |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
426 let err_code = 'E474:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
427 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
428 call assert_fails(entire_cmd, err_code) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
429 call assert_equal(6, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
430 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
431 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
432 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
433 " Test for the error behavior (post count only) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
434 for c in tc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
435 call s:reconstruct_tabpage_for_test(6) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
436 let entire_cmd = 'tabonly' . c[2] . ' ' . c[1] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
437 let err_code = 'E474:' |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
438 call assert_fails(entire_cmd, err_code) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
439 call assert_equal(6, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
440 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
441 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
442 call assert_fails('tabonly -+', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
443 call assert_fails('tabonly +2-', 'E474:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
444 call assert_equal(6, tabpagenr('$')) |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
445 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
446 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
447 new |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
448 only! |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
449 endfunction |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
450 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
451 func Test_tabnext_on_buf_unload1() |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
452 " This once caused a crash |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
453 new |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
454 tabedit |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
455 tabfirst |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
456 au BufUnload <buffer> tabnext |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
457 q |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
458 |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
459 while tabpagenr('$') > 1 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
460 bwipe! |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
461 endwhile |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
462 endfunc |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
463 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
464 func Test_tabnext_on_buf_unload2() |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
465 " This once caused a crash |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
466 tabedit |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
467 autocmd BufUnload <buffer> tabnext |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
468 file x |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
469 edit y |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
470 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
471 while tabpagenr('$') > 1 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
472 bwipe! |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
473 endwhile |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
474 endfunc |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
475 |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
476 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
477 " vim: shiftwidth=2 sts=2 expandtab |