Mercurial > vim
annotate src/testdir/test_tabpage.vim @ 36186:631e068e17a9 draft default tip
Added tag v9.1.0741 for changeset 9a68d0ac2749673c4ca12d108958c3e12b7c6845
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 23 Sep 2024 20:45:07 +0200 |
parents | 22f63041670a |
children |
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()) |
34639
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
120 silent -tabmove |
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
121 call assert_equal(5, tabpagenr()) |
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
122 silent -2 tabmove |
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
123 call assert_equal(3, tabpagenr()) |
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
124 silent -2 tabmove |
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
125 call assert_equal(1, tabpagenr()) |
14455
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
126 |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
127 norm! 2gt |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
128 call assert_equal(2, tabpagenr()) |
34639
ceee63c7f7aa
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Christian Brabandt <cb@256bit.org>
parents:
34338
diff
changeset
|
129 " The following are a no-op |
14455
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
130 tabmove 2 |
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 2tabmove |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
133 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
|
134 tabmove 1 |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
135 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
|
136 1tabmove |
f713e016097d
patch 8.1.0241: effect of ":tabmove N" is not clear
Christian Brabandt <cb@256bit.org>
parents:
13982
diff
changeset
|
137 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
|
138 |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
139 call assert_fails('let t = tabpagenr("@")', 'E15:') |
20158
94f05de75e9f
patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
140 call assert_equal(0, tabpagewinnr(-1)) |
10739
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("99tabmove", 'E16:') |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
142 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
|
143 call assert_fails("-99tabmove", 'E16:') |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
144 call assert_fails("tabmove foo", 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
145 call assert_fails("tabmove 99", 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
146 call assert_fails("tabmove +99", 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
147 call assert_fails("tabmove -99", 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
148 call assert_fails("tabmove -3+", 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
149 call assert_fails("tabmove $3", 'E475:') |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
150 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
|
151 1tabonly! |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
152 tabmove 1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
153 call assert_equal(1, tabpagenr()) |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
154 tabnew |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
155 call assert_fails("-2tabmove", 'E16:') |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
156 tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 endfunc |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 |
32282
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
159 func Test_tabpage_drop() |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
160 edit f1 |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
161 tab split f2 |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
162 tab split f3 |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
163 normal! gt |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
164 call assert_equal(1, tabpagenr()) |
34305
9335b3e58558
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()
Christian Brabandt <cb@256bit.org>
parents:
34190
diff
changeset
|
165 tab drop f4 |
9335b3e58558
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()
Christian Brabandt <cb@256bit.org>
parents:
34190
diff
changeset
|
166 call assert_equal(1, tabpagenr('#')) |
32282
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
167 |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
168 tab drop f3 |
34305
9335b3e58558
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()
Christian Brabandt <cb@256bit.org>
parents:
34190
diff
changeset
|
169 call assert_equal(4, tabpagenr()) |
9335b3e58558
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()
Christian Brabandt <cb@256bit.org>
parents:
34190
diff
changeset
|
170 call assert_equal(2, tabpagenr('#')) |
9335b3e58558
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()
Christian Brabandt <cb@256bit.org>
parents:
34190
diff
changeset
|
171 bwipe! |
32282
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
172 bwipe! |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
173 bwipe! |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
174 bwipe! |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
175 call assert_equal(1, tabpagenr('$')) |
34190
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
176 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
177 call assert_equal(1, winnr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
178 call assert_equal('', bufname('')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
179 call writefile(['L1', 'L2'], 'Xdropfile', 'D') |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
180 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
181 " Test for ':tab drop single-file': reuse current buffer |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
182 let expected_nr = bufnr() |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
183 tab drop Xdropfile |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
184 call assert_equal(1, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
185 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
186 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
187 bwipe! |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
188 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
189 " Test for ':tab drop single-file': not reuse modified buffer |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
190 set modified |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
191 let expected_nr = bufnr() + 1 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
192 tab drop Xdropfile |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
193 call assert_equal(2, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
194 call assert_equal(2, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
195 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
196 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
197 bwipe! |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
198 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
199 " Test for ':tab drop single-file': multiple tabs already exist |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
200 tab split f2 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
201 tab split f3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
202 let expected_nr = bufnr() + 1 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
203 tab drop Xdropfile |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
204 call assert_equal(4, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
205 call assert_equal(4, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
206 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
207 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
208 %bwipe! |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
209 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
210 " Test for ':tab drop multi-files': reuse current buffer |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
211 let expected_nr = bufnr() |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
212 tab drop Xdropfile f1 f2 f3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
213 call assert_equal(1, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
214 call assert_equal(4, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
215 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
216 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
217 %bwipe! |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
218 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
219 " Test for ':tab drop multi-files': not reuse modified buffer |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
220 set modified |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
221 let expected_nr = bufnr() + 1 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
222 tab drop Xdropfile f1 f2 f3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
223 call assert_equal(2, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
224 call assert_equal(5, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
225 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
226 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
227 %bwipe! |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
228 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
229 " Test for ':tab drop multi-files': multiple tabs already exist |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
230 tab split f2 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
231 tab split f3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
232 let expected_nr = bufnr() + 1 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
233 tab drop a b c |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
234 call assert_equal(4, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
235 call assert_equal(6, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
236 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
237 let expected_nr = bufnr() + 3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
238 tab drop Xdropfile f1 f2 f3 |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
239 call assert_equal(5, tabpagenr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
240 call assert_equal(8, tabpagenr('$')) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
241 call assert_equal(expected_nr, bufnr()) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
242 call assert_equal('L2', getline(2)) |
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
243 %bwipe! |
32282
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
244 endfunc |
e47739c49487
patch 9.0.1472: ":drop fname" may change the last used tab page
Bram Moolenaar <Bram@vim.org>
parents:
32062
diff
changeset
|
245 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
246 " Test autocommands |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 function Test_tabpage_with_autocmd() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 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
|
249 augroup TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 au! |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 autocmd TabEnter * call add(s:li, 'TabEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
252 autocmd WinEnter * call add(s:li, 'WinEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
253 autocmd BufEnter * call add(s:li, 'BufEnter') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
254 autocmd TabLeave * call add(s:li, 'TabLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 autocmd WinLeave * call add(s:li, 'WinLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
256 autocmd BufLeave * call add(s:li, 'BufLeave') |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
257 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
258 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
259 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
260 let t:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
261 C tab split |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
262 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
|
263 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 let t:a='b' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 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
|
267 let t:a='c' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 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
|
269 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
|
270 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
271 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
272 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
|
273 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
|
274 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
|
275 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
|
276 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 C vsplit |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 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
|
281 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 let w:a='a' |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 let tabn=tabpagenr() |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
284 let winr=range(1, winnr('$')) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 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
|
287 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
|
288 call assert_equal(['a', 'a'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 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
|
290 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
|
291 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
|
292 call assert_equal(['2', '4'], s:li) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
293 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
294 augroup TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
295 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
|
296 augroup END |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
298 C tabnext 3 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
299 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
|
300 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
301 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
302 autocmd! TabDestructive TabEnter |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
303 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 C tabnew |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 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
|
306 let s:li = [] |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 C tabnext 1 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 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
|
309 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
310 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
|
311 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
|
312 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
|
313 C tabnext 2 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
314 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
|
315 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
|
316 call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')]) |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
317 |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 delcommand C |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
319 autocmd! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
320 augroup! TabDestructive |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
321 autocmd! TestTabpageGroup |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
322 augroup! TestTabpageGroup |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
323 1tabonly! |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
324 endfunction |
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
325 |
19112
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
326 " 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
|
327 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
|
328 augroup TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
329 au! |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
330 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
|
331 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
|
332 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
|
333 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
|
334 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
|
335 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
|
336 augroup END |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
337 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
338 let s:li = [] |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
339 tab drop test1 |
34190
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
340 call assert_equal(['BufEnter'], s:li) |
19112
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
341 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
342 let s:li = [] |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
343 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
|
344 call assert_equal([ |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
345 \ '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
|
346 \ 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter', |
34190
4f8b57f8b07a
patch 9.1.0046: :drop does not re-use empty buffer
Christian Brabandt <cb@256bit.org>
parents:
33947
diff
changeset
|
347 \ 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter', 'BufEnter'], s:li) |
19112
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
348 |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
349 autocmd! TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
350 augroup! TestTabpageGroup |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
351 1tabonly! |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
352 endfunction |
0b337617877e
patch 8.2.0116: BufEnter autocmd not triggered on ":tab drop"
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
353 |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
354 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
|
355 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18000
diff
changeset
|
356 |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
357 for n in range(4) |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
358 tabedit |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
359 endfor |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
360 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
361 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
|
362 exec 'tabnext ' . a:pre_nr |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
363 exec a:cmd |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
364 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
|
365 call assert_equal('help', &buftype) |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
366 helpclose |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
367 endfunc |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
368 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
369 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
|
370 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
|
371 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
|
372 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
|
373 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
|
374 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
|
375 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
|
376 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
|
377 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
|
378 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
|
379 call assert_fails('99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
380 call assert_fails('+99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
381 call assert_fails('-99tab help', 'E16:') |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
382 |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
383 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
|
384 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
385 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
386 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
387 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
|
388 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
|
389 normal! G |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
390 exec a:cmd |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
391 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
|
392 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
393 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
394 " 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
|
395 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
|
396 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
|
397 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
398 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
|
399 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
400 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
401 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
|
402 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
|
403 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
|
404 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
|
405 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
|
406 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
|
407 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
|
408 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
|
409 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
|
410 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 call Check_tab_count(3, 'tabnext $', 5) |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
420 call assert_fails('tabnext 0', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
421 call assert_fails('tabnext .', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
422 call assert_fails('tabnext -+', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
423 call assert_fails('tabnext +2-', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
424 call assert_fails('tabnext $3', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
425 call assert_fails('tabnext 99', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
426 call assert_fails('tabnext +99', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
427 call assert_fails('tabnext -99', 'E475:') |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
428 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
429 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
430 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
431 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
432 " 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
|
433 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
|
434 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
|
435 tabedit |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
436 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
|
437 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
438 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
439 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
|
440 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
|
441 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
|
442 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
|
443 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
|
444 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
|
445 for n in range(2) |
21552
cbc570e66d11
patch 8.2.1326: Vim9: skipping over white space after list
Bram Moolenaar <Bram@vim.org>
parents:
21459
diff
changeset
|
446 for c in ['0', '.+3', '+', '+2', '-', '-2', '$', '+99', '-99'] |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
447 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
|
448 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
|
449 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
|
450 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
451 let entire_cmd = cmd . ' ' . c |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
452 let err_code = 'E475:' |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
453 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
454 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
|
455 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
456 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
457 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
458 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
459 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
460 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
461 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
462 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
|
463 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
|
464 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
465 0tabedit n0 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
466 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
|
467 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
|
468 if n == 1 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
469 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
|
470 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
471 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
472 endfunc |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
473 |
13982
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
474 func Test_tabpage_ctrl_pgup_pgdown() |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
475 enew! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
476 tabnew tab1 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
477 tabnew tab2 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
478 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
479 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
480 exe "norm! \<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
481 call assert_equal(2, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
482 exe "norm! \<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
483 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
484 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
485 " Check wrapping at last or first page. |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
486 exe "norm! \<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
487 call assert_equal(1, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
488 exe "norm! \<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
489 call assert_equal(3, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
490 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
491 " 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
|
492 " - {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
|
493 " - {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
|
494 exe "norm! 2\<C-PageUp>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
495 call assert_equal(1, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
496 exe "norm! 2\<C-PageDown>" |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
497 call assert_equal(2, tabpagenr()) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
498 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
499 1tabonly! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
500 endfunc |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
501 |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
502 " 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
|
503 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
|
504 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
505 " pre count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
506 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
|
507 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
|
508 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
|
509 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
|
510 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
|
511 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
|
512 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
|
513 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
|
514 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
515 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
|
516 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
|
517 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
|
518 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
|
519 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
|
520 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
|
521 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
|
522 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
|
523 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
524 " post count |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
525 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
|
526 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
|
527 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
|
528 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
|
529 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
|
530 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
|
531 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
|
532 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
|
533 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
534 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
|
535 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
|
536 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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 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
|
542 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
543 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
|
544 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
|
545 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
|
546 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
|
547 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
|
548 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
|
549 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
550 let entire_cmd = 'tabclose ' . c |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
551 let err_code = 'E475:' |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
552 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
553 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
|
554 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
|
555 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
556 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
557 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
558 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
|
559 call assert_fails('tabclose 3', 'E37:') |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
560 call assert_fails('tabclose -+', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
561 call assert_fails('tabclose +2-', 'E475:') |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
562 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
|
563 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
564 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
565 endfunction |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
566 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
567 " 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
|
568 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
|
569 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
570 " 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
|
571 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
|
572 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
|
573 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
|
574 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
|
575 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
|
576 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
|
577 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
578 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
579 " 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
|
580 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
|
581 \ [2, '', '!'], |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
582 \ [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
|
583 \ ] |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
584 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
|
585 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
|
586 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
|
587 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
|
588 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
|
589 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
590 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
|
591 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
592 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
|
593 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
|
594 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
595 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
596 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
597 " 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
|
598 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
|
599 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
|
600 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
|
601 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
|
602 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
|
603 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
|
604 else |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
605 let entire_cmd = 'tabonly ' . c |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
606 let err_code = 'E475:' |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
607 endif |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
608 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
|
609 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
|
610 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
611 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
612 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
613 " 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
|
614 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
|
615 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
|
616 let entire_cmd = 'tabonly' . c[2] . ' ' . c[1] |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
617 let err_code = 'E475:' |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
618 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
|
619 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
|
620 endfor |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
621 |
21459
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
622 call assert_fails('tabonly -+', 'E475:') |
a422bd80b434
patch 8.2.1280: Ex command error cannot contain an argument
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
623 call assert_fails('tabonly +2-', 'E475:') |
10739
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
624 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
|
625 |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
626 1tabonly! |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
627 new |
380e706814da
patch 8.0.0259: tab commands do not handle count correctly
Christian Brabandt <cb@256bit.org>
parents:
10432
diff
changeset
|
628 only! |
9927
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
629 endfunction |
e1a8b2601fe0
commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
Christian Brabandt <cb@256bit.org>
parents:
9906
diff
changeset
|
630 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
631 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
|
632 " This once caused a crash |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
633 new |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
634 tabedit |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
635 tabfirst |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
636 au BufUnload <buffer> tabnext |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
637 q |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
638 |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
639 while tabpagenr('$') > 1 |
10082
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
640 bwipe! |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
641 endwhile |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
642 endfunc |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
643 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
644 func Test_tabnext_on_buf_unload2() |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
645 " This once caused a crash |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
646 tabedit |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
647 autocmd BufUnload <buffer> tabnext |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
648 file x |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
649 edit y |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
650 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
651 while tabpagenr('$') > 1 |
7fc6103c6651
commit https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
Christian Brabandt <cb@256bit.org>
parents:
10076
diff
changeset
|
652 bwipe! |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
653 endwhile |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
654 endfunc |
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
655 |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
656 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
|
657 " 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
|
658 edit Xtest |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
659 new |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
660 only |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
661 set bufhidden=delete |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
662 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
|
663 tabnew tab1 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
664 tabnew tab2 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
665 1tabn |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
666 q! |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
667 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
|
668 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
|
669 " clean up |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
670 while tabpagenr('$') > 1 |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
671 bwipe! |
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
672 endwhile |
12688
a6a935b3270e
patch 8.0.1222: test functions interfere with each other
Christian Brabandt <cb@256bit.org>
parents:
11635
diff
changeset
|
673 buf Xtest |
11635
70bc7b107610
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Christian Brabandt <cb@256bit.org>
parents:
10739
diff
changeset
|
674 endfunc |
10076
bc30991c3e98
commit https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
Christian Brabandt <cb@256bit.org>
parents:
9927
diff
changeset
|
675 |
13982
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
676 func Test_tabs() |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
677 enew! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
678 tabnew tab1 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
679 norm ixxx |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
680 let a=split(execute(':tabs'), "\n") |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
681 call assert_equal(['Tab page 1', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
682 \ ' [No Name]', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
683 \ 'Tab page 2', |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
684 \ '> + tab1'], a) |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
685 |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
686 1tabonly! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
687 bw! |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
688 endfunc |
29bad8212db3
patch 8.1.0009: tabpages insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
13268
diff
changeset
|
689 |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
690 func Test_tabpage_cmdheight() |
20625
116c7bd5e980
patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
691 CheckRunVimInTerminal |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
692 call writefile([ |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
693 \ '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
|
694 \ '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
|
695 \ 'tabnew', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
696 \ '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
|
697 \ 'tabnext', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
698 \ 'redraw!', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
699 \ '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
|
700 \ 'tabnext', |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
701 \ 'redraw', |
30865
c8ebe35b2475
patch 9.0.0767: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
702 \ ], 'XTest_tabpage_cmdheight', 'D') |
16477
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
703 " 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
|
704 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
|
705 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
|
706 |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
707 call StopVimInTerminal(buf) |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
708 endfunc |
8cc31b1b1d23
patch 8.1.1242: no cmdline redraw when tabpages have different 'cmdheight'
Bram Moolenaar <Bram@vim.org>
parents:
16376
diff
changeset
|
709 |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
710 " 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
|
711 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
|
712 tabnew |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
713 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
|
714 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
|
715 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
|
716 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
|
717 tabonly |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
718 endfunc |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19112
diff
changeset
|
719 |
20941
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
720 " Pressing <C-PageUp> in insert mode should go to the previous tab page |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
721 " and <C-PageDown> should go to the next tab page |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
722 func Test_tabpage_Ctrl_Pageup() |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
723 tabnew |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
724 call feedkeys("i\<C-PageUp>", 'xt') |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
725 call assert_equal(1, tabpagenr()) |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
726 call feedkeys("i\<C-PageDown>", 'xt') |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
727 call assert_equal(2, tabpagenr()) |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
728 %bw! |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
729 endfunc |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
730 |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
731 " Return the terminal key code for selecting a tab page from the tabline. This |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
732 " sequence contains the following codes: a CSI (0x9b), KS_TABLINE (0xf0), |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
733 " KS_FILLER (0x58) and then the tab page number. |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
734 func TabLineSelectPageCode(tabnr) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
735 return "\x9b\xf0\x58" .. nr2char(a:tabnr) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
736 endfunc |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
737 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
738 " Return the terminal key code for opening a new tabpage from the tabpage |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
739 " menu. This sequence consists of the following codes: a CSI (0x9b), |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
740 " KS_TABMENU (0xef), KS_FILLER (0x58), the tab page number and |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
741 " TABLINE_MENU_NEW (2). |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
742 func TabMenuNewItemCode(tabnr) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
743 return "\x9b\xef\x58" .. nr2char(a:tabnr) .. nr2char(2) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
744 endfunc |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
745 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
746 " Return the terminal key code for closing a tabpage from the tabpage menu. |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
747 " This sequence consists of the following codes: a CSI (0x9b), KS_TABMENU |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
748 " (0xef), KS_FILLER (0x58), the tab page number and TABLINE_MENU_CLOSE (1). |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
749 func TabMenuCloseItemCode(tabnr) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
750 return "\x9b\xef\x58" .. nr2char(a:tabnr) .. nr2char(1) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
751 endfunc |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
752 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
753 " Test for using the tabpage menu from the insert and normal modes |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
754 func Test_tabline_tabmenu() |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
755 " only works in GUI |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
756 CheckGui |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
757 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
758 %bw! |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
759 tabnew |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
760 tabnew |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
761 call assert_equal(3, tabpagenr()) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
762 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
763 " go to tab page 2 in normal mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
764 call feedkeys(TabLineSelectPageCode(2), "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
765 call assert_equal(2, tabpagenr()) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
766 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
767 " close tab page 3 in normal mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
768 call feedkeys(TabMenuCloseItemCode(3), "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
769 call assert_equal(2, tabpagenr('$')) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
770 call assert_equal(2, tabpagenr()) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
771 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
772 " open new tab page before tab page 1 in normal mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
773 call feedkeys(TabMenuNewItemCode(1), "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
774 call assert_equal(1, tabpagenr()) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
775 call assert_equal(3, tabpagenr('$')) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
776 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
777 " go to tab page 2 in operator-pending mode (should beep) |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
778 call assert_beeps('call feedkeys("c" .. TabLineSelectPageCode(2), "Lx!")') |
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
779 call assert_equal(2, tabpagenr()) |
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
780 call assert_equal(3, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
781 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
782 " open new tab page before tab page 1 in operator-pending mode (should beep) |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
783 call assert_beeps('call feedkeys("c" .. TabMenuNewItemCode(1), "Lx!")') |
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
784 call assert_equal(1, tabpagenr()) |
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
785 call assert_equal(4, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
786 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
787 " open new tab page after tab page 3 in normal mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
788 call feedkeys(TabMenuNewItemCode(4), "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
789 call assert_equal(4, tabpagenr()) |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
790 call assert_equal(5, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
791 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
792 " go to tab page 2 in insert mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
793 call feedkeys("i" .. TabLineSelectPageCode(2) .. "\<C-C>", "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
794 call assert_equal(2, tabpagenr()) |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
795 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
796 " close tab page 2 in insert mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
797 call feedkeys("i" .. TabMenuCloseItemCode(2) .. "\<C-C>", "Lx!") |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
798 call assert_equal(4, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
799 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
800 " open new tab page before tab page 3 in insert mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
801 call feedkeys("i" .. TabMenuNewItemCode(3) .. "\<C-C>", "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
802 call assert_equal(3, tabpagenr()) |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
803 call assert_equal(5, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
804 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
805 " open new tab page after tab page 4 in insert mode |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
806 call feedkeys("i" .. TabMenuNewItemCode(5) .. "\<C-C>", "Lx!") |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
807 call assert_equal(5, tabpagenr()) |
22502
1503ecd54f8a
patch 8.2.1799: some Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21727
diff
changeset
|
808 call assert_equal(6, tabpagenr('$')) |
20947
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
809 |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
810 %bw! |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
811 endfunc |
1c71605f0c5d
patch 8.2.1025: tabpage menu and tabline not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20941
diff
changeset
|
812 |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
813 " Test for changing the current tab page from an autocmd when closing a tab |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
814 " page. |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
815 func Test_tabpage_switchtab_on_close() |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
816 only |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
817 tabnew |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
818 tabnew |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
819 " Test for BufLeave |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
820 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
821 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
822 au BufLeave * tabfirst |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
823 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
824 tabclose |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
825 call assert_equal(1, tabpagenr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
826 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
827 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
828 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
829 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
830 " Test for WinLeave |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
831 $tabnew |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
832 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
833 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
834 au WinLeave * tabfirst |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
835 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
836 tabclose |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
837 call assert_equal(1, tabpagenr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
838 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
839 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
840 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
841 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
842 " Test for TabLeave |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
843 $tabnew |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
844 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
845 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
846 au TabLeave * tabfirst |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
847 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
848 tabclose |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
849 call assert_equal(1, tabpagenr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
850 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
851 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
852 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
853 augroup! T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
854 tabonly |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
855 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
856 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
857 " Test for closing the destination tabpage when jumping from one to another. |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
858 func Test_tabpage_close_on_switch() |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
859 tabnew |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
860 tabnew |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
28289
diff
changeset
|
861 edit Xtabfile |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
862 augroup T2 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
863 au! |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
28289
diff
changeset
|
864 au BufLeave Xtabfile 1tabclose |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
865 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
866 tabfirst |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
867 call assert_equal(2, tabpagenr()) |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
28289
diff
changeset
|
868 call assert_equal('Xtabfile', @%) |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
869 augroup T2 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
870 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
871 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
872 augroup! T2 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
873 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
874 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20947
diff
changeset
|
875 |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
876 " Test for jumping to last accessed tabpage |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
877 func Test_lastused_tabpage() |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
878 tabonly! |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
879 call assert_equal(0, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
880 call assert_beeps('call feedkeys("g\<Tab>", "xt")') |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
881 call assert_beeps('call feedkeys("\<C-Tab>", "xt")') |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
882 call assert_beeps('call feedkeys("\<C-W>g\<Tab>", "xt")') |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
883 call assert_fails('tabnext #', 'E475:') |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
884 |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
885 " open four tab pages |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
886 tabnew |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
887 tabnew |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
888 tabnew |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
889 |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
890 2tabnext |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
891 |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
892 " Test for g<Tab> |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
893 call assert_equal(4, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
894 call feedkeys("g\<Tab>", "xt") |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
895 call assert_equal(4, tabpagenr()) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
896 call assert_equal(2, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
897 |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
898 " Test for <C-Tab> |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
899 call feedkeys("\<C-Tab>", "xt") |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
900 call assert_equal(2, tabpagenr()) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
901 call assert_equal(4, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
902 |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
903 " Test for <C-W>g<Tab> |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
904 call feedkeys("\<C-W>g\<Tab>", "xt") |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
905 call assert_equal(4, tabpagenr()) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
906 call assert_equal(2, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
907 |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
908 " Test for :tabnext # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
909 tabnext # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
910 call assert_equal(2, tabpagenr()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
911 call assert_equal(4, tabpagenr('#')) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
912 |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
913 " Try to jump to a closed tab page |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
914 tabclose # |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
915 call assert_equal(0, tabpagenr('#')) |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
916 call feedkeys("g\<Tab>", "xt") |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
917 call assert_equal(2, tabpagenr()) |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
918 call feedkeys("\<C-Tab>", "xt") |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
919 call assert_equal(2, tabpagenr()) |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
920 call feedkeys("\<C-W>g\<Tab>", "xt") |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
921 call assert_equal(2, tabpagenr()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
922 call assert_fails('tabnext #', 'E475:') |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
923 call assert_equal(2, tabpagenr()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
924 |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
925 " Test for :tabonly # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
926 let wnum = win_getid() |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
927 $tabnew |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
928 tabonly # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
929 call assert_equal(wnum, win_getid()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
930 call assert_equal(1, tabpagenr('$')) |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
931 |
21727
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
932 " Test for :tabmove # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
933 tabnew |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
934 let wnum = win_getid() |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
935 tabnew |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
936 tabnew |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
937 tabnext 2 |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
938 tabmove # |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
939 call assert_equal(4, tabpagenr()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
940 call assert_equal(wnum, win_getid()) |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
941 |
860cad58f557
patch 8.2.1413: previous tab page not usable from an Ex command
Bram Moolenaar <Bram@vim.org>
parents:
21703
diff
changeset
|
942 tabonly! |
21703
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
943 endfunc |
22583b9d4efd
patch 8.2.1401: cannot jump to the last used tabpage
Bram Moolenaar <Bram@vim.org>
parents:
21552
diff
changeset
|
944 |
28289
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
945 " Test for tabpage allocation failure |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
946 func Test_tabpage_alloc_failure() |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
947 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
948 call assert_fails('tabnew', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
949 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
950 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
951 edit Xfile1 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
952 call assert_fails('tabedit Xfile2', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
953 call assert_equal(1, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
954 call assert_equal(1, tabpagenr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
955 call assert_equal('Xfile1', @%) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
956 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
957 new |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
958 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
959 call assert_fails('wincmd T', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
960 bw! |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
961 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
962 call test_alloc_fail(GetAllocId('newtabpage_tvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
963 call assert_fails('tab split', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
964 call assert_equal(2, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
965 call assert_equal(1, tabpagenr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
966 endfunc |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
967 |
35665
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
968 func Test_tabpage_tabclose() |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
969 " Default behaviour, move to the right. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
970 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
971 norm! 4gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
972 setl tcl= |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
973 tabclose |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
974 call assert_equal("n3", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
975 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
976 " Move to the left. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
977 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
978 norm! 4gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
979 setl tcl=left |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
980 tabclose |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
981 call assert_equal("n1", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
982 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
983 " Move to the last used tab page. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
984 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
985 norm! 5gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
986 norm! 2gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
987 setl tcl=uselast |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
988 tabclose |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
989 call assert_equal("n3", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
990 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
991 " Same, but the last used tab page is invalid. Move to the right. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
992 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
993 norm! 5gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
994 norm! 3gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
995 setl tcl=uselast |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
996 tabclose 5 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
997 tabclose! |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
998 call assert_equal("n2", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
999 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1000 " Same, but the last used tab page is invalid. Move to the left. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1001 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1002 norm! 5gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1003 norm! 3gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1004 setl tcl=uselast,left |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1005 tabclose 5 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1006 tabclose! |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1007 call assert_equal("n0", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1008 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1009 " Move left when moving right is not possible. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1010 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1011 setl tcl= |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1012 norm! 6gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1013 tabclose |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1014 call assert_equal("n3", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1015 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1016 " Move right when moving left is not possible. |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1017 call s:reconstruct_tabpage_for_test(6) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1018 setl tcl=left |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1019 norm! 1gt |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1020 tabclose |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1021 call assert_equal("n0", bufname()) |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1022 |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1023 setl tcl& |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1024 endfunc |
22f63041670a
patch 9.1.0572: cannot specify tab page closing behaviour
Christian Brabandt <cb@256bit.org>
parents:
34639
diff
changeset
|
1025 |
32062
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1026 " this was giving ml_get errors |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1027 func Test_tabpage_last_line() |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1028 enew |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1029 call setline(1, repeat(['a'], &lines + 5)) |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1030 $ |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1031 tabnew |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1032 call setline(1, repeat(['b'], &lines + 20)) |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1033 $ |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1034 tabNext |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1035 call assert_equal('a', getline('.')) |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1036 |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1037 bwipe! |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1038 bwipe! |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1039 endfunc |
8c9f63a518f5
patch 9.0.1362: ml_get error when going to another tab
Bram Moolenaar <Bram@vim.org>
parents:
30865
diff
changeset
|
1040 |
33947
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1041 " this was causing an endless loop |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1042 func Test_tabpage_drop_tabmove() |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1043 augroup TestTabpageTabmove |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1044 au! |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1045 autocmd! TabEnter * :if tabpagenr() > 1 | tabmove - | endif |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1046 augroup end |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1047 $tab drop XTab_99.log |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1048 $tab drop XTab_98.log |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1049 $tab drop XTab_97.log |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1050 |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1051 autocmd! TestTabpageTabmove |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1052 augroup! TestTabpageTabmove |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1053 |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1054 " clean up |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1055 bwipe! |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1056 bwipe! |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1057 bwipe! |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1058 endfunc |
f4d88db48a63
patch 9.0.2168: Moving tabpages on :drop may cause an endless loop
Christian Brabandt <cb@256bit.org>
parents:
32282
diff
changeset
|
1059 |
34338
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1060 " Test that settabvar() shouldn't change the last accessed tabpage. |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1061 func Test_lastused_tabpage_settabvar() |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1062 tabonly! |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1063 tabnew |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1064 tabnew |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1065 tabnew |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1066 call assert_equal(3, tabpagenr('#')) |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1067 |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1068 call settabvar(2, 'myvar', 'tabval') |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1069 call assert_equal('tabval', gettabvar(2, 'myvar')) |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1070 call assert_equal(3, tabpagenr('#')) |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1071 |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1072 bwipe! |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1073 bwipe! |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1074 bwipe! |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1075 endfunc |
1451ee5fbe21
patch 9.1.0102: settabvar() may change the last accessed tabpage
Christian Brabandt <cb@256bit.org>
parents:
34305
diff
changeset
|
1076 |
9906
1ed0cab95f9a
commit https://github.com/vim/vim/commit/1381d791478ee77c8368b89a3d4954316bf839b5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1077 " vim: shiftwidth=2 sts=2 expandtab |