Mercurial > vim
annotate src/testdir/test_tabpage.vim @ 19899:eea0515a4e8a
Added tag v8.2.0505 for changeset 648752e0d5790f29b05f4fc6efa9ebbb8cd11c5b
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 03 Apr 2020 13:00:04 +0200 |
parents | 67fbe280a502 |
children | 94f05de75e9f |
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 |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
3 source screendump.vim |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
4 source check.vim |
13982
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
5 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 function Test_tabpage() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
7 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
8 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 bw! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " 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
|
11 tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal(2, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 quit |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " Open three tab pages and use ":tabdo" |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 0tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 1tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 $tabnew |
10270
e5dddd764fef
commit https://github.com/vim/vim/commit/3e8474dd50f64c998bb665ce852f584a58dede6b
Christian Brabandt <cb@256bit.org>
parents:
10136
diff
changeset
|
19 %del |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 tabdo call append(line('$'), tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 tabclose! 2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 tabrewind |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 let line1 = getline('$') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 undo |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 q |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 tablast |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 let line2 = getline('$') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 q! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call append(line('$'), line1) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call append(line('$'), line2) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 unlet line1 line2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 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
|
33 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 " 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
|
35 " 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
|
36 " are correctly set. |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 tabfirst |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call settabvar(2, 'val_num', 100) |
18000
7a19c8d6bb9e
patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17918
diff
changeset
|
40 eval 'SetTabVar test'->settabvar(2, 'val_str') |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 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
|
42 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 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
|
44 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 tabnext 2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 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
|
47 tabclose |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 |
13268
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
49 " Test for ":tab drop exist-file" to keep current window. |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
50 sp test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
51 tab drop test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
52 call assert_true(tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1) |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
53 close |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
54 " |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
55 " |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
56 " Test for ":tab drop new-file" to keep current window of tabpage 1. |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
57 split |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
58 tab drop newfile |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
59 call assert_true(tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1) |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
60 tabclose |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
61 q |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
62 " |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
63 " |
17918
9606c0adc148
patch 8.1.1955: tests contain typos
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
64 " Test for ":tab drop multi-opened-file" to keep current tabpage and window. |
13268
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
65 new test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
66 tabnew |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
67 new test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
68 tab drop test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
69 call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1) |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
70 tabclose |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
71 q |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
72 " |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
73 " |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
74 " Test for ":tab drop vertical-split-window" to jump test1 buffer |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
75 tabedit test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
76 vnew |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
77 tabfirst |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
78 tab drop test1 |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
79 call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)]) |
50e1077e0c3d
patch 8.0.1508: the :drop command is not always available
Christian Brabandt <cb@256bit.org>
parents:
12688
diff
changeset
|
80 1tabonly |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 " |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 for i in range(9) | tabnew | endfor |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 normal! 1gt |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 tabmove 5 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 .tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 tabmove - |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 call assert_equal(4, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 tabmove + |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 call assert_equal(5, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 tabmove -2 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 call assert_equal(3, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 tabmove +4 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 call assert_equal(7, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 0tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 $tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 tabmove 0 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 call assert_equal(1, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 tabmove $ |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 call assert_equal(10, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 3tabmove |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal(4, tabpagenr()) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 7tabmove 5 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 call assert_equal(5, tabpagenr()) |
15573
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
112 -tabmove |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
113 call assert_equal(4, tabpagenr()) |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
114 +tabmove |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
115 call assert_equal(5, tabpagenr()) |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
116 -2tabmove |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
117 call assert_equal(3, tabpagenr()) |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
118 +3tabmove |
060cb54565c1
patch 8.1.0794: white space before " -Ntabmove" causes problems
Bram Moolenaar <Bram@vim.org>
parents:
14455
diff
changeset
|
119 call assert_equal(6, tabpagenr()) |
14455
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
120 |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
121 " The following are a no-op |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
122 norm! 2gt |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
123 call assert_equal(2, tabpagenr()) |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
124 tabmove 2 |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
125 call assert_equal(2, tabpagenr()) |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
126 2tabmove |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
127 call assert_equal(2, tabpagenr()) |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
128 tabmove 1 |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
129 call assert_equal(2, tabpagenr()) |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
130 1tabmove |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
131 call assert_equal(2, tabpagenr()) |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
132 |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
133 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
|
134 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
|
135 call assert_fails("-99tabmove", 'E16:') |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 call assert_fails("tabmove $3", 'E474:') |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
142 call assert_fails("%tabonly", 'E16:') |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
143 1tabonly! |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
144 tabnew |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
145 call assert_fails("-2tabmove", 'E474:') |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
146 tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 endfunc |
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 " Test autocommands |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 function Test_tabpage_with_autocmd() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 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
|
152 augroup TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 au! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 autocmd TabEnter * call add(s:li, 'TabEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 autocmd WinEnter * call add(s:li, 'WinEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 autocmd BufEnter * call add(s:li, 'BufEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 autocmd TabLeave * call add(s:li, 'TabLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 autocmd WinLeave * call add(s:li, 'WinLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 autocmd BufLeave * call add(s:li, 'BufLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 let t:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 C tab split |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 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
|
166 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 let t:a='b' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 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
|
170 let t:a='c' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 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
|
172 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
|
173 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 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
|
176 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
|
177 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
|
178 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
|
179 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 C vsplit |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 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
|
184 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 let tabn=tabpagenr() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 let winr=range(1, winnr('$')) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 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
|
190 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
|
191 call assert_equal(['a', 'a'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 let s:li = [] |
18000
7a19c8d6bb9e
patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17918
diff
changeset
|
193 C call map(copy(winr), '(v:val*2)->settabwinvar(' .. tabn .. ', v:val, ''a'')') |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 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
|
195 call assert_equal(['2', '4'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 augroup TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 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
|
199 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 C tabnext 3 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 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
|
203 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 autocmd! TabDestructive TabEnter |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
208 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
|
209 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 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
|
212 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 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
|
214 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
|
215 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
|
216 C tabnext 2 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
217 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
|
218 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
|
219 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
220 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
221 delcommand C |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 autocmd! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 augroup! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 autocmd! TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 augroup! TestTabpageGroup |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
226 1tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 endfunction |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
228 |
19112
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
229 " Test autocommands on tab drop |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
230 function Test_tabpage_with_autocmd_tab_drop() |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
231 augroup TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
232 au! |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
233 autocmd TabEnter * call add(s:li, 'TabEnter') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
234 autocmd WinEnter * call add(s:li, 'WinEnter') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
235 autocmd BufEnter * call add(s:li, 'BufEnter') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
236 autocmd TabLeave * call add(s:li, 'TabLeave') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
237 autocmd WinLeave * call add(s:li, 'WinLeave') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
238 autocmd BufLeave * call add(s:li, 'BufLeave') |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
239 augroup END |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
240 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
241 let s:li = [] |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
242 tab drop test1 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
243 call assert_equal(['BufLeave', 'BufEnter'], s:li) |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
244 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
245 let s:li = [] |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
246 tab drop test2 test3 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
247 call assert_equal([ |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
248 \ 'TabLeave', 'TabEnter', 'TabLeave', 'TabEnter', |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
249 \ 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter', |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
250 \ 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter'], s:li) |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
251 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
252 autocmd! TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
253 augroup! TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
254 1tabonly! |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
255 endfunction |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
256 |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
257 function Test_tabpage_with_tab_modifier() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
258 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
259 |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
260 for n in range(4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
261 tabedit |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
262 endfor |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
263 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
264 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
|
265 exec 'tabnext ' . a:pre_nr |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
266 exec a:cmd |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
267 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
|
268 call assert_equal('help', &buftype) |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
269 helpclose |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
270 endfunc |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
271 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
272 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
|
273 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
|
274 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
|
275 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
|
276 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
|
277 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
|
278 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
|
279 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
|
280 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
|
281 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
|
282 call assert_fails('99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
283 call assert_fails('+99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
284 call assert_fails('-99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
285 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
286 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
|
287 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
288 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
289 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
290 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
|
291 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
|
292 normal! G |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
293 exec a:cmd |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
294 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
|
295 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
296 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
297 " 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
|
298 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
|
299 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
|
300 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
301 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
|
302 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
303 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 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
|
318 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
|
319 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
|
320 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
|
321 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
|
322 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
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 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
|
330 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
|
331 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
332 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
333 endfunction |
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 " 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
|
336 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
|
337 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
|
338 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
339 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
|
340 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
341 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
342 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
|
343 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
|
344 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
|
345 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
|
346 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
|
347 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
|
348 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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
354 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
|
355 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
|
356 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
357 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
|
358 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
359 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
360 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
361 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
362 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
363 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
364 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
365 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
|
366 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
|
367 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
368 0tabedit n0 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
369 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
|
370 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
|
371 if n == 1 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
372 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
|
373 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
374 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
375 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
376 |
13982
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
377 func Test_tabpage_ctrl_pgup_pgdown() |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
378 enew! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
379 tabnew tab1 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
380 tabnew tab2 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
381 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
382 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
383 exe "norm! \<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
384 call assert_equal(2, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
385 exe "norm! \<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
386 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
387 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
388 " Check wrapping at last or first page. |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
389 exe "norm! \<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
390 call assert_equal(1, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
391 exe "norm! \<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
392 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
393 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
394 " With a count, <C-PageUp> and <C-PageDown> are not symmetrical somehow: |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
395 " - {count}<C-PageUp> goes {count} pages downward (relative count) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
396 " - {count}<C-PageDown> goes to page number {count} (absolute count) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
397 exe "norm! 2\<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
398 call assert_equal(1, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
399 exe "norm! 2\<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
400 call assert_equal(2, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
401 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
402 1tabonly! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
403 endfunc |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
404 |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
405 " 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
|
406 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
|
407 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
408 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
409 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
|
410 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
418 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
|
419 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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
427 " post count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
428 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
|
429 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
|
430 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
|
431 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
|
432 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
|
433 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
|
434 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
|
435 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
|
436 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
437 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
|
438 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
|
439 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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 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
|
445 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
446 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
|
447 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
|
448 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
|
449 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
|
450 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
|
451 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
|
452 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
453 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
|
454 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
|
455 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
456 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
|
457 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
|
458 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
459 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
460 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
461 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
|
462 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
|
463 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
|
464 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
|
465 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
|
466 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
467 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
468 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
469 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
470 " 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
|
471 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
|
472 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
473 " 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
|
474 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
|
475 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
|
476 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
|
477 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
|
478 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
|
479 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
|
480 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
481 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
482 " 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
|
483 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
|
484 \ [2, '', '!'], |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
485 \ [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
|
486 \ ] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
487 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
|
488 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
|
489 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
|
490 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
|
491 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
|
492 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
493 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
|
494 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
495 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
|
496 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
|
497 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
498 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
499 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
500 " 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
|
501 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
|
502 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
|
503 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
|
504 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
|
505 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
|
506 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
|
507 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
508 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
|
509 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
|
510 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
511 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
|
512 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
|
513 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
514 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
515 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
516 " 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
|
517 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
|
518 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
|
519 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
|
520 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
|
521 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
|
522 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
|
523 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
524 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
525 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
|
526 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
|
527 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
|
528 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
529 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
530 new |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
531 only! |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
532 endfunction |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
533 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
534 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
|
535 " This once caused a crash |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
536 new |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
537 tabedit |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
538 tabfirst |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
539 au BufUnload <buffer> tabnext |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
540 q |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
541 |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
542 while tabpagenr('$') > 1 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
543 bwipe! |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
544 endwhile |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
545 endfunc |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
546 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
547 func Test_tabnext_on_buf_unload2() |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
548 " This once caused a crash |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
549 tabedit |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
550 autocmd BufUnload <buffer> tabnext |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
551 file x |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
552 edit y |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
553 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
554 while tabpagenr('$') > 1 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
555 bwipe! |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
556 endwhile |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
557 endfunc |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
558 |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
559 func Test_close_on_quitpre() |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
560 " This once caused a crash |
12688
a6a935b3270e
patch 8.0.1222: test functions interfere with each other
Christian Brabandt <cb@256bit.org>
parents:
11635
diff
changeset
|
561 edit Xtest |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
562 new |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
563 only |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
564 set bufhidden=delete |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
565 au QuitPre <buffer> close |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
566 tabnew tab1 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
567 tabnew tab2 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
568 1tabn |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
569 q! |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
570 call assert_equal(1, tabpagenr()) |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
571 call assert_equal(2, tabpagenr('$')) |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
572 " clean up |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
573 while tabpagenr('$') > 1 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
574 bwipe! |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
575 endwhile |
12688
a6a935b3270e
patch 8.0.1222: test functions interfere with each other
Christian Brabandt <cb@256bit.org>
parents:
11635
diff
changeset
|
576 buf Xtest |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
577 endfunc |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
578 |
13982
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
579 func Test_tabs() |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
580 enew! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
581 tabnew tab1 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
582 norm ixxx |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
583 let a=split(execute(':tabs'), "\n") |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
584 call assert_equal(['Tab page 1', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
585 \ ' [No Name]', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
586 \ 'Tab page 2', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
587 \ '> + tab1'], a) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
588 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
589 1tabonly! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
590 bw! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
591 endfunc |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
592 |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
593 func Test_tabpage_cmdheight() |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
594 if !CanRunVimInTerminal() |
16965
ba7727889385
patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents:
16566
diff
changeset
|
595 throw 'Skipped: cannot make screendumps' |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
596 endif |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
597 call writefile([ |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
598 \ 'set laststatus=2', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
599 \ 'set cmdheight=2', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
600 \ 'tabnew', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
601 \ 'set cmdheight=3', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
602 \ 'tabnext', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
603 \ 'redraw!', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
604 \ 'echo "hello\nthere"', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
605 \ 'tabnext', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
606 \ 'redraw', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
607 \ ], 'XTest_tabpage_cmdheight') |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
608 " Check that cursor line is concealed |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
609 let buf = RunVimInTerminal('-S XTest_tabpage_cmdheight', {'statusoff': 3}) |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
610 call VerifyScreenDump(buf, 'Test_tabpage_cmdheight', {}) |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
611 |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
612 call StopVimInTerminal(buf) |
16566
72afc10bf322
patch 8.1.1286: running tests leaves XTest_tabpage_cmdheight file behind
Bram Moolenaar <Bram@vim.org>
parents:
16477
diff
changeset
|
613 call delete('XTest_tabpage_cmdheight') |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
614 endfunc |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
615 |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
616 " Test for closing the tab page from a command window |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
617 func Test_tabpage_close_cmdwin() |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
618 tabnew |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
619 call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt') |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
620 call assert_equal(2, tabpagenr('$')) |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
621 call feedkeys("q/:tabonly\<CR>\<Esc>", 'xt') |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
622 call assert_equal(2, tabpagenr('$')) |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
623 tabonly |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
624 endfunc |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
625 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
626 " vim: shiftwidth=2 sts=2 expandtab |