Mercurial > vim
annotate src/testdir/test_window_id.vim @ 29544:80b4c435450a v9.0.0113
patch 9.0.0113: has() is not strict about parsing the patch version
Commit: https://github.com/vim/vim/commit/d90f91fe3075bb51668ed926182b2163da9df001
Author: K.Takata <kentkt@csc.jp>
Date: Sat Jul 30 15:43:59 2022 +0100
patch 9.0.0113: has() is not strict about parsing the patch version
Problem: has() is not strict about parsing the patch version.
Solution: Check the version more strictly. (Ken Takata, closes https://github.com/vim/vim/issues/10752)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Jul 2022 16:45:05 +0200 |
parents | 08940efa6b4e |
children |
rev | line source |
---|---|
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test using the window ID. |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
2 |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
3 source check.vim |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_win_getid() |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 edit one |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 let id1 = win_getid() |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
8 let w:one = 'one' |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 split two |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let id2 = win_getid() |
8536
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
11 let bufnr2 = bufnr('%') |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
12 let w:two = 'two' |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 split three |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let id3 = win_getid() |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
15 let w:three = 'three' |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 tabnew |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 edit four |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 let id4 = win_getid() |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
19 let w:four = 'four' |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 split five |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 let id5 = win_getid() |
8536
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
22 let bufnr5 = bufnr('%') |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
23 let w:five = 'five' |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 tabnext |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 wincmd w |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal("two", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_equal(id2, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let nr2 = winnr() |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 wincmd w |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal("one", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal(id1, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let nr1 = winnr() |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 wincmd w |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_equal("three", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call assert_equal(id3, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 let nr3 = winnr() |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
38 call assert_equal('one', getwinvar(id1, 'one')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
39 call assert_equal('two', getwinvar(id2, 'two')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
40 call assert_equal('three', getwinvar(id3, 'three')) |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 tabnext |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 call assert_equal("five", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 call assert_equal(id5, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 let nr5 = winnr() |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 wincmd w |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 call assert_equal("four", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 call assert_equal(id4, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 let nr4 = winnr() |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
49 call assert_equal('four', getwinvar(id4, 'four')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
50 call assert_equal('five', getwinvar(id5, 'five')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
51 call settabwinvar(1, id2, 'two', '2') |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
52 call setwinvar(id4, 'four', '4') |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 tabnext |
9223
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
54 call assert_equal('4', gettabwinvar(2, id4, 'four')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
55 call assert_equal('five', gettabwinvar(2, id5, 'five')) |
6c4d610fce0a
commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068
Christian Brabandt <cb@256bit.org>
parents:
8536
diff
changeset
|
56 call assert_equal('2', getwinvar(id2, 'two')) |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 exe nr1 . "wincmd w" |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 call assert_equal(id1, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 exe nr2 . "wincmd w" |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call assert_equal(id2, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 exe nr3 . "wincmd w" |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal(id3, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 tabnext |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 exe nr4 . "wincmd w" |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 call assert_equal(id4, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 exe nr5 . "wincmd w" |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 call assert_equal(id5, win_getid()) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call win_gotoid(id2) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 call assert_equal("two", expand("%")) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
72 eval id4->win_gotoid() |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal("four", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call win_gotoid(id1) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 call assert_equal("one", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 call win_gotoid(id5) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 call assert_equal("five", expand("%")) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 call assert_equal(0, win_id2win(9999)) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
80 call assert_equal(nr5, id5->win_id2win()) |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call assert_equal(0, win_id2win(id1)) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 tabnext |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 call assert_equal(nr1, win_id2win(id1)) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call assert_equal([0, 0], win_id2tabwin(9999)) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
86 call assert_equal([1, nr2], id2->win_id2tabwin()) |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal([2, nr4], win_id2tabwin(id4)) |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
8536
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
89 call assert_equal([], win_findbuf(9999)) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
90 call assert_equal([id2], bufnr2->win_findbuf()) |
8536
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
91 call win_gotoid(id5) |
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
92 split |
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
93 call assert_equal(sort([id5, win_getid()]), sort(win_findbuf(bufnr5))) |
09041d2fd7d0
commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f
Christian Brabandt <cb@256bit.org>
parents:
8534
diff
changeset
|
94 |
20178
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
95 call assert_fails('let w = win_getid([])', 'E745:') |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
96 call assert_equal(0, win_getid(-1)) |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
97 call assert_equal(-1, win_getid(1, -1)) |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
98 |
8534
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 only! |
485d4d8a97f6
commit https://github.com/vim/vim/commit/86edef664efccbfe685906c854b9cdd04e56f2d5
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 endfunc |
10377
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
101 |
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
102 func Test_win_getid_curtab() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
103 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
104 |
10377
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
105 tabedit X |
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
106 tabfirst |
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
107 copen |
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
108 only |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
109 call assert_equal(win_getid(1), 1->win_getid( 1)) |
10377
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
110 tabclose! |
dd397210a2d3
commit https://github.com/vim/vim/commit/8e639052638a9bb8c7dd6e3e10776b1218cec1a3
Christian Brabandt <cb@256bit.org>
parents:
9223
diff
changeset
|
111 endfunc |
14587
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
112 |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
113 func Test_winlayout() |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
114 let w1 = win_getid() |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
115 call assert_equal(['leaf', w1], winlayout()) |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
116 |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
117 split |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
118 let w2 = win_getid() |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
119 call assert_equal(['col', [['leaf', w2], ['leaf', w1]]], winlayout()) |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
120 |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
121 split |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
122 let w3 = win_getid() |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
123 call assert_equal(['col', [['leaf', w3], ['leaf', w2], ['leaf', w1]]], winlayout()) |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
124 |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
125 2wincmd w |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
126 vsplit |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
127 let w4 = win_getid() |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
128 call assert_equal(['col', [['leaf', w3], ['row', [['leaf', w4], ['leaf', w2]]], ['leaf', w1]]], winlayout()) |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
129 |
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
130 only! |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
131 |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
132 let w1 = win_getid() |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
133 call assert_equal(['leaf', w1], winlayout(1)) |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
134 tabnew |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
135 let w2 = win_getid() |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
136 call assert_equal(['leaf', w2], 2->winlayout()) |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
14587
diff
changeset
|
137 tabclose |
20178
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
138 |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
139 call assert_equal([], winlayout(-1)) |
14587
d33220d3bc27
patch 8.1.0307: there is no good way to get the window layout
Christian Brabandt <cb@256bit.org>
parents:
10377
diff
changeset
|
140 endfunc |
20178
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
141 |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
142 " vim: shiftwidth=2 sts=2 expandtab |