Mercurial > vim
annotate src/testdir/test91.in @ 6897:d3a23af4bba1 v7.4.768
patch 7.4.768
Problem: :diffoff only works properly once.
Solution: Also make :diffoff work when used a second time. (Olaf Dabrunz)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 03 Jul 2015 15:06:56 +0200 |
parents | 4176c48c7dd5 |
children | e8eccb9621f7 |
rev | line source |
---|---|
4157 | 1 Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar(). |
2 vim: set ft=vim : | |
3 | |
4 STARTTEST | |
5 :so small.vim | |
5231
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
6 :so mbyte.vim |
4157 | 7 :" |
4297 | 8 :" Test for getbufvar() |
9 :" Use strings to test for memory leaks. | |
10 :let b:var_num = '1234' | |
11 :let def_num = '5678' | |
4157 | 12 :$put =string(getbufvar(1, 'var_num')) |
13 :$put =string(getbufvar(1, 'var_num', def_num)) | |
14 :$put =string(getbufvar(1, '')) | |
15 :$put =string(getbufvar(1, '', def_num)) | |
16 :unlet b:var_num | |
17 :$put =string(getbufvar(1, 'var_num', def_num)) | |
18 :$put =string(getbufvar(1, '')) | |
19 :$put =string(getbufvar(1, '', def_num)) | |
20 :$put =string(getbufvar(9, '')) | |
21 :$put =string(getbufvar(9, '', def_num)) | |
22 :unlet def_num | |
23 :$put =string(getbufvar(1, '&autoindent')) | |
24 :$put =string(getbufvar(1, '&autoindent', 1)) | |
25 :" | |
5231
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
26 :" Open new window with forced option values |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
27 :set fileformats=unix,dos |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
28 :new ++ff=dos ++bin ++enc=iso-8859-2 |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
29 :let otherff = getbufvar(bufnr('%'), '&fileformat') |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
30 :let otherbin = getbufvar(bufnr('%'), '&bin') |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
31 :let otherfenc = getbufvar(bufnr('%'), '&fenc') |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
32 :close |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
33 :$put =otherff |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
34 :$put =string(otherbin) |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
35 :$put =otherfenc |
74d2f3188cd0
updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents:
4297
diff
changeset
|
36 :unlet otherff otherbin otherfenc |
4157 | 37 :" test for getwinvar() |
38 :let w:var_str = "Dance" | |
39 :let def_str = "Chance" | |
40 :$put =string(getwinvar(1, 'var_str')) | |
41 :$put =string(getwinvar(1, 'var_str', def_str)) | |
42 :$put =string(getwinvar(1, '')) | |
43 :$put =string(getwinvar(1, '', def_str)) | |
44 :unlet w:var_str | |
45 :$put =string(getwinvar(1, 'var_str', def_str)) | |
46 :$put =string(getwinvar(1, '')) | |
47 :$put =string(getwinvar(1, '', def_str)) | |
48 :$put =string(getwinvar(9, '')) | |
49 :$put =string(getwinvar(9, '', def_str)) | |
50 :$put =string(getwinvar(1, '&nu')) | |
51 :$put =string(getwinvar(1, '&nu', 1)) | |
52 :unlet def_str | |
53 :" | |
54 :" test for gettabvar() | |
55 :tabnew | |
56 :tabnew | |
57 :let t:var_list = [1, 2, 3] | |
6197 | 58 :let t:other = 777 |
4157 | 59 :let def_list = [4, 5, 6, 7] |
60 :tabrewind | |
61 :$put =string(gettabvar(3, 'var_list')) | |
62 :$put =string(gettabvar(3, 'var_list', def_list)) | |
63 :$put =string(gettabvar(3, '')) | |
64 :$put =string(gettabvar(3, '', def_list)) | |
65 :tablast | |
66 :unlet t:var_list | |
67 :tabrewind | |
68 :$put =string(gettabvar(3, 'var_list', def_list)) | |
69 :$put =string(gettabvar(9, '')) | |
70 :$put =string(gettabvar(9, '', def_list)) | |
71 :$put =string(gettabvar(3, '&nu')) | |
72 :$put =string(gettabvar(3, '&nu', def_list)) | |
73 :unlet def_list | |
74 :tabonly | |
75 :" | |
76 :" test for gettabwinvar() | |
77 :tabnew | |
78 :tabnew | |
79 :tabprev | |
80 :split | |
81 :split | |
82 :wincmd w | |
83 :vert split | |
84 :wincmd w | |
85 :let w:var_dict = {'dict': 'tabwin'} | |
86 :let def_dict = {'dict2': 'newval'} | |
87 :wincmd b | |
88 :tabrewind | |
89 :$put =string(gettabwinvar(2, 3, 'var_dict')) | |
90 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict)) | |
91 :$put =string(gettabwinvar(2, 3, '')) | |
92 :$put =string(gettabwinvar(2, 3, '', def_dict)) | |
93 :tabnext | |
94 :3wincmd w | |
95 :unlet w:var_dict | |
96 :tabrewind | |
97 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict)) | |
98 :$put =string(gettabwinvar(2, 3, '')) | |
99 :$put =string(gettabwinvar(2, 3, '', def_dict)) | |
100 :$put =string(gettabwinvar(2, 9, '')) | |
101 :$put =string(gettabwinvar(2, 9, '', def_dict)) | |
102 :$put =string(gettabwinvar(9, 3, '')) | |
103 :$put =string(gettabwinvar(9, 3, '', def_dict)) | |
104 :unlet def_dict | |
105 :$put =string(gettabwinvar(2, 3, '&nux')) | |
106 :$put =string(gettabwinvar(2, 3, '&nux', 1)) | |
107 :tabonly | |
108 :" | |
109 :/^start/,$wq! test.out | |
110 ENDTEST | |
111 | |
112 start: |