annotate src/testdir/test91.in @ 11193:75ccc8a15a51 v8.0.0483

patch 8.0.0483: illegal memory access when using :all commit https://github.com/vim/vim/commit/f79225ed4f81bc579bb3360ad2eb06adc8058153 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 18 23:11:04 2017 +0100 patch 8.0.0483: illegal memory access when using :all Problem: Illegal memory access when using :all. (Dominique Pelle) Solution: Adjust the cursor position right after setting "curwin".
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Mar 2017 23:15:04 +0100
parents 5780bd3a5a7e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10889
5780bd3a5a7e patch 8.0.0334: can't access b:changedtick from a dict reference
Christian Brabandt <cb@256bit.org>
parents: 7042
diff changeset
1 Tests for getwinvar(), gettabvar() and gettabwinvar().
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 vim: set ft=vim :
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 STARTTEST
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
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
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :"
7042
e8eccb9621f7 commit https://github.com/vim/vim/commit/7e47d1ac6a9ae0e5a7167aa34ff651a9c39c1641
Christian Brabandt <cb@256bit.org>
parents: 6197
diff changeset
8 :" Use strings to test for memory leaks.
e8eccb9621f7 commit https://github.com/vim/vim/commit/7e47d1ac6a9ae0e5a7167aa34ff651a9c39c1641
Christian Brabandt <cb@256bit.org>
parents: 6197
diff changeset
9 :" First, check that in an empty window, gettabvar() returns the correct value
e8eccb9621f7 commit https://github.com/vim/vim/commit/7e47d1ac6a9ae0e5a7167aa34ff651a9c39c1641
Christian Brabandt <cb@256bit.org>
parents: 6197
diff changeset
10 :let t:testvar='abcd'
e8eccb9621f7 commit https://github.com/vim/vim/commit/7e47d1ac6a9ae0e5a7167aa34ff651a9c39c1641
Christian Brabandt <cb@256bit.org>
parents: 6197
diff changeset
11 :$put =string(gettabvar(1,'testvar'))
e8eccb9621f7 commit https://github.com/vim/vim/commit/7e47d1ac6a9ae0e5a7167aa34ff651a9c39c1641
Christian Brabandt <cb@256bit.org>
parents: 6197
diff changeset
12 :$put =string(gettabvar(1,'testvar'))
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 :" test for getwinvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 :let w:var_str = "Dance"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 :let def_str = "Chance"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 :$put =string(getwinvar(1, 'var_str'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :$put =string(getwinvar(1, 'var_str', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :$put =string(getwinvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 :$put =string(getwinvar(1, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :unlet w:var_str
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 :$put =string(getwinvar(1, 'var_str', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 :$put =string(getwinvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 :$put =string(getwinvar(1, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 :$put =string(getwinvar(9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 :$put =string(getwinvar(9, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 :$put =string(getwinvar(1, '&nu'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 :$put =string(getwinvar(1, '&nu', 1))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 :unlet def_str
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 :" test for gettabvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 :let t:var_list = [1, 2, 3]
6197
4176c48c7dd5 updated for version 7.4.434
Bram Moolenaar <bram@vim.org>
parents: 5231
diff changeset
35 :let t:other = 777
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 :let def_list = [4, 5, 6, 7]
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 :$put =string(gettabvar(3, 'var_list'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 :$put =string(gettabvar(3, 'var_list', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 :$put =string(gettabvar(3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 :$put =string(gettabvar(3, '', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 :tablast
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 :unlet t:var_list
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 :$put =string(gettabvar(3, 'var_list', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 :$put =string(gettabvar(9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 :$put =string(gettabvar(9, '', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 :$put =string(gettabvar(3, '&nu'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 :$put =string(gettabvar(3, '&nu', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 :unlet def_list
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 :tabonly
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 :" test for gettabwinvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 :tabprev
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 :split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 :split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 :wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 :vert split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 :wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 :let w:var_dict = {'dict': 'tabwin'}
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 :let def_dict = {'dict2': 'newval'}
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 :wincmd b
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 :$put =string(gettabwinvar(2, 3, 'var_dict'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 :$put =string(gettabwinvar(2, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 :$put =string(gettabwinvar(2, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 :tabnext
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 :3wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 :unlet w:var_dict
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 :$put =string(gettabwinvar(2, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 :$put =string(gettabwinvar(2, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 :$put =string(gettabwinvar(2, 9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 :$put =string(gettabwinvar(2, 9, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 :$put =string(gettabwinvar(9, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 :$put =string(gettabwinvar(9, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 :unlet def_dict
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 :$put =string(gettabwinvar(2, 3, '&nux'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 :$put =string(gettabwinvar(2, 3, '&nux', 1))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 :tabonly
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 :/^start/,$wq! test.out
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 ENDTEST
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 start: