annotate src/testdir/test62.in @ 9151:d0f69d0bea7a v7.4.1859

commit https://github.com/vim/vim/commit/ef3abc6442260e9a0314970a532400b05571d3fe Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 29 16:44:26 2016 +0200 patch 7.4.1859 Problem: Cannot use a function reference for "exit_cb". Solution: Use get_callback(). (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sun, 29 May 2016 16:45:05 +0200
parents c0bc9b60fb8a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
1 Tests for tab pages
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
2
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
3 STARTTEST
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
4 :so small.vim
5846
8f84e906d454 updated for version 7.4.266
Bram Moolenaar <bram@vim.org>
parents: 5194
diff changeset
5 :lang C
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
6 :" Simple test for opening and closing a tab page
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
7 :tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
8 :let nr = tabpagenr()
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
9 :q
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
10 :call append(line('$'), 'tab page ' . nr)
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 856
diff changeset
11 :unlet nr
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
12 :"
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
13 :" Open three tab pages and use ":tabdo"
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
14 :0tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
15 :1tabnew
6472
22f95a018b13 updated for version 7.4.565
Bram Moolenaar <bram@vim.org>
parents: 5846
diff changeset
16 :$tabnew
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
17 :tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
18 :tabclose! 2
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
19 :tabrewind
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
20 :let line1 = getline('$')
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
21 :undo
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
22 :q
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
23 :tablast
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
24 :let line2 = getline('$')
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
25 :q!
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
26 :call append(line('$'), line1)
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
27 :call append(line('$'), line2)
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 856
diff changeset
28 :unlet line1 line2
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
29 :"
2240
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
30 :" Test for settabvar() and gettabvar() functions. Open a new tab page and
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
31 :" set 3 variables to a number, string and a list. Verify that the variables
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
32 :" are correctly set.
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
33 :tabnew
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
34 :tabfirst
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
35 :call settabvar(2, 'val_num', 100)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
36 :call settabvar(2, 'val_str', 'SetTabVar test')
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
37 :call settabvar(2, 'val_list', ['red', 'blue', 'green'])
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
38 :"
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
39 :let test_status = 'gettabvar: fail'
5194
45b2278e6f46 updated for version 7.4a.023
Bram Moolenaar <bram@vim.org>
parents: 5186
diff changeset
40 :if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test' && gettabvar(2, 'val_list') == ['red', 'blue', 'green']
2240
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
41 : let test_status = 'gettabvar: pass'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
42 :endif
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
43 :call append(line('$'), test_status)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
44 :"
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
45 :tabnext 2
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
46 :let test_status = 'settabvar: fail'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
47 :if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green']
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
48 : let test_status = 'settabvar: pass'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
49 :endif
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
50 :tabclose
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
51 :call append(line('$'), test_status)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
52 :"
3408
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
53 :if has('gui') || has('clientserver')
3380
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
54 :" Test for ":tab drop exist-file" to keep current window.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
55 :sp test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
56 :tab drop test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
57 :let test_status = 'tab drop 1: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
58 :if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
59 : let test_status = 'tab drop 1: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
60 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
61 :close
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
62 :call append(line('$'), test_status)
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
63 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
64 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
65 :" Test for ":tab drop new-file" to keep current window of tabpage 1.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
66 :split
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
67 :tab drop newfile
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
68 :let test_status = 'tab drop 2: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
69 :if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
70 : let test_status = 'tab drop 2: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
71 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
72 :tabclose
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
73 :q
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
74 :call append(line('$'), test_status)
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
75 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
76 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
77 :" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
78 :new test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
79 :tabnew
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
80 :new test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
81 :tab drop test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
82 :let test_status = 'tab drop 3: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
83 :if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
84 : let test_status = 'tab drop 3: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
85 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
86 :tabclose
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
87 :q
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
88 :call append(line('$'), test_status)
3408
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
89 :else
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
90 :" :drop not supported
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
91 :call append(line('$'), 'tab drop 1: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
92 :call append(line('$'), 'tab drop 2: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
93 :call append(line('$'), 'tab drop 3: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
94 :endif
3380
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
95 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
96 :"
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
97 :for i in range(9) | tabnew | endfor
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
98 1gt
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
99 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
100 :tabmove 5
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
101 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
102 :.tabmove
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
103 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
104 :tabmove -
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
105 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
106 :tabmove +
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
107 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
108 :tabmove -2
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
109 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
110 :tabmove +4
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
111 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
112 :tabmove
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
113 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
114 :tabmove -20
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
115 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
116 :tabmove +20
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
117 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
118 :0tabmove
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
119 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
120 :$tabmove
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
121 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
122 :tabmove 0
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
123 :$put =tabpagenr()
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
124 :tabmove $
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
125 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
126 :3tabmove
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
127 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
128 :7tabmove 5
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
129 :$put =tabpagenr()
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
130 :let a='No error caught.'
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
131 :try
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
132 :tabmove foo
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
133 :catch E474
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
134 :let a='E474 caught.'
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
135 :endtry
6775
c0bc9b60fb8a patch 7.4.709
Bram Moolenaar <bram@vim.org>
parents: 6472
diff changeset
136 :$put =a
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
137 :"
4354
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
138 :" Test autocommands
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
139 :tabonly!
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
140 :let g:r=[]
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
141 :command -nargs=1 -bar C :call add(g:r, '=== ' . <q-args> . ' ===')|<args>
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
142 :function Test()
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
143 let hasau=has('autocmd')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
144 if hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
145 autocmd TabEnter * :call add(g:r, 'TabEnter')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
146 autocmd WinEnter * :call add(g:r, 'WinEnter')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
147 autocmd BufEnter * :call add(g:r, 'BufEnter')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
148 autocmd TabLeave * :call add(g:r, 'TabLeave')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
149 autocmd WinLeave * :call add(g:r, 'WinLeave')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
150 autocmd BufLeave * :call add(g:r, 'BufLeave')
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
151 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
152 let t:a='a'
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
153 C tab split
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
154 if !hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
155 let g:r+=['WinLeave', 'TabLeave', 'WinEnter', 'TabEnter']
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
156 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
157 let t:a='b'
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
158 C tabnew
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
159 if !hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
160 let g:r+=['WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufLeave', 'BufEnter']
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
161 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
162 let t:a='c'
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
163 call add(g:r, join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")')))
5186
bea5eb942011 updated for version 7.4a.019
Bram Moolenaar <bram@vim.org>
parents: 4354
diff changeset
164 C call map(range(1, tabpagenr('$')), 'settabvar(v:val, ''a'', v:val*2)')
4354
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
165 call add(g:r, join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")')))
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
166 let w:a='a'
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
167 C vsplit
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
168 if !hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
169 let g:r+=['WinLeave', 'WinEnter']
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
170 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
171 let w:a='a'
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
172 let tabn=tabpagenr()
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
173 let winr=range(1, winnr('$'))
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
174 C tabnext 1
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
175 if !hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
176 let g:r+=['BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter']
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
177 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
178 call add(g:r, join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")')))
5186
bea5eb942011 updated for version 7.4a.019
Bram Moolenaar <bram@vim.org>
parents: 4354
diff changeset
179 C call map(copy(winr), 'settabwinvar('.tabn.', v:val, ''a'', v:val*2)')
4354
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
180 call add(g:r, join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")')))
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
181 if hasau
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
182 augroup TabDestructive
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
183 autocmd TabEnter * :C tabnext 2 | C tabclose 3
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
184 augroup END
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
185 C tabnext 3
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
186 let g:r+=[tabpagenr().'/'.tabpagenr('$')]
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
187 autocmd! TabDestructive TabEnter
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
188 C tabnew
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
189 C tabnext 1
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
190 autocmd TabDestructive TabEnter * nested :C tabnext 2 | C tabclose 3
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
191 C tabnext 3
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
192 let g:r+=[tabpagenr().'/'.tabpagenr('$')]
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
193 else
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
194 let g:r+=["=== tabnext 3 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","=== tabclose 3 ===","2/2","=== tabnew ===","WinLeave","TabLeave","WinEnter","TabEnter","BufLeave","BufEnter","=== tabnext 1 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","BufEnter","=== tabnext 3 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","=== tabclose 3 ===","BufEnter","=== tabclose 3 ===","2/2",]
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
195 endif
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
196 endfunction
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
197 :call Test()
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
198 :$ put =g:r
c80838526eeb updated for version 7.3.926
Bram Moolenaar <bram@vim.org>
parents: 3662
diff changeset
199 :"
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
200 :"
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
201 :/^Results/,$w! test.out
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
202 :qa!
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
203 ENDTEST
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
204
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
205 Results: