annotate src/testdir/test_eval.in @ 6402:7f48abe500e1 v7.4.532

updated for version 7.4.532 Problem: When using 'incsearch' "2/pattern/e" highlights the first match. Solution: Move the code to set extra_col inside the loop for count. (Ozaki Kiichi)
author Bram Moolenaar <bram@vim.org>
date Thu, 27 Nov 2014 17:29:56 +0100
parents 332a5c2b2956
children b01ca71f93b2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
1 Test for various eval features. vim: set ft=vim :
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
2
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
3 Note: system clipboard support is not tested. I do not think anybody will thank
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
4 me for messing with clipboard.
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 STARTTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :so small.vim
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
8 :set encoding=latin1
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
9 :set noswapfile
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
10 :lang C
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
11 :fun AppendRegContents(reg)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
12 call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1))))
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
13 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
14 :command -nargs=? AR :call AppendRegContents(<q-args>)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
15 :fun SetReg(...)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
16 call call('setreg', a:000)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
17 call append('$', printf('{{{2 setreg(%s)', string(a:000)[1:-2]))
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
18 call AppendRegContents(a:1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
19 if a:1 isnot# '='
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
20 execute "silent normal! Go==\n==\e\"".a:1."P"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
21 endif
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
22 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
23 :fun ErrExe(str)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
24 call append('$', 'Executing '.a:str)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
25 try
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
26 execute a:str
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
27 catch
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
28 $put =v:exception
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
29 endtry
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
30 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
31 :fun Test()
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
32 $put ='{{{1 let tests'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
33 let @" = 'abc'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
34 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
35 let @" = "abc\n"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
36 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
37 let @" = "abc\<C-m>"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
38 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
39 let @= = '"abc"'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
40 AR =
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
41
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
42 $put ='{{{1 Basic setreg tests'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
43 call SetReg('a', 'abcA', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
44 call SetReg('b', 'abcB', 'v')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
45 call SetReg('c', 'abcC', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
46 call SetReg('d', 'abcD', 'V')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
47 call SetReg('e', 'abcE', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
48 call SetReg('f', 'abcF', "\<C-v>")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
49 call SetReg('g', 'abcG', 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
50 call SetReg('h', 'abcH', "\<C-v>10")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
51 call SetReg('I', 'abcI')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
52
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
53 $put ='{{{1 Appending single lines with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
54 call SetReg('A', 'abcAc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
55 call SetReg('A', 'abcAl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
56 call SetReg('A', 'abcAc2','c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
57 call SetReg('b', 'abcBc', 'ca')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
58 call SetReg('b', 'abcBb', 'ba')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
59 call SetReg('b', 'abcBc2','ca')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
60 call SetReg('b', 'abcBb2','b50a')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
61
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
62 call SetReg('C', 'abcCl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
63 call SetReg('C', 'abcCc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
64 call SetReg('D', 'abcDb', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
65
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
66 call SetReg('E', 'abcEb', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
67 call SetReg('E', 'abcEl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
68 call SetReg('F', 'abcFc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
69
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
70 $put ='{{{1 Appending NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
71 call setreg('a', 'abcA2', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
72 call setreg('b', 'abcB2', 'v')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
73 call setreg('c', 'abcC2', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
74 call setreg('d', 'abcD2', 'V')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
75 call setreg('e', 'abcE2', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
76 call setreg('f', 'abcF2', "\<C-v>")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
77 call setreg('g', 'abcG2', 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
78 call setreg('h', 'abcH2', "\<C-v>10")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
79 call setreg('I', 'abcI2')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
80
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
81 call SetReg('A', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
82 call SetReg('B', "\n", 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
83 call SetReg('C', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
84 call SetReg('D', "\n", 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
85 call SetReg('E', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
86 call SetReg('F', "\n", 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
87
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
88 $put ='{{{1 Setting lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
89 call SetReg('a', ['abcA3'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
90 call SetReg('b', ['abcB3'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
91 call SetReg('c', ['abcC3'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
92 call SetReg('d', ['abcD3'])
5810
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
93 call SetReg('e', [1, 2, 'abc', 3])
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
94 call SetReg('f', [1, 2, 3])
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
95
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
96 $put ='{{{1 Appending lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
97 call SetReg('A', ['abcA3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
98 call SetReg('b', ['abcB3l'], 'la')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
99 call SetReg('C', ['abcC3b'], 'lb')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
100 call SetReg('D', ['abcD32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
101
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
102 call SetReg('A', ['abcA32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
103 call SetReg('B', ['abcB3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
104 call SetReg('C', ['abcC3l'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
105 call SetReg('D', ['abcD3b'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
106
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
107 $put ='{{{1 Appending lists with NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
108 call SetReg('A', ["\n", 'abcA3l2'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
109 call SetReg('B', ["\n", 'abcB3c2'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
110 call SetReg('C', ["\n", 'abcC3b2'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
111 call SetReg('D', ["\n", 'abcD3b50'],'b50')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
112
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
113 $put ='{{{1 Setting lists with NLs with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
114 call SetReg('a', ['abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
115 call SetReg('b', ['abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2"], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
116 call SetReg('c', ['abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2"], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
117 call SetReg('d', ['abcD4b-0', "\n", "abcD4b-2\n", "\nabcD4b-3", "abcD4b-4\nabcD4b-4-2"], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
118 call SetReg('e', ['abcE4b10-0', "\n", "abcE4b10-2\n", "\nabcE4b10-3", "abcE4b10-4\nabcE4b10-4-2"], 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
119
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
120 $put ='{{{1 Search and expressions'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
121 call SetReg('/', ['abc/'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
122 call SetReg('/', ["abc/\n"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
123 call SetReg('=', ['"abc/"'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
124 call SetReg('=', ["\"abc/\n\""])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
125
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
126 $put ='{{{1 Errors'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
127 call ErrExe('call setreg()')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
128 call ErrExe('call setreg(1)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
129 call ErrExe('call setreg(1, 2, 3, 4)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
130 call ErrExe('call setreg([], 2)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
131 call ErrExe('call setreg(1, {})')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
132 call ErrExe('call setreg(1, 2, [])')
5810
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
133 call ErrExe('call setreg("/", ["1", "2"])')
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
134 call ErrExe('call setreg("=", ["1", "2"])')
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
135 call ErrExe('call setreg(1, ["", "", [], ""])')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
136 endfun
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
137 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
138 :call Test()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
139 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
140 :delfunction SetReg
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
141 :delfunction AppendRegContents
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
142 :delfunction ErrExe
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
143 :delfunction Test
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
144 :delcommand AR
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
145 :call garbagecollect(1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
146 :"
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
147 :" function name not starting with capital
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
148 :try
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
149 :func! g:test()
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
150 :echo "test"
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
151 :endfunc
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
152 :catch
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
153 :$put =v:exception
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
154 :endtry
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
155 :"
5834
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
156 :" function name includes a colon
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
157 :try
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
158 :func! b:test()
5834
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
159 :echo "test"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
160 :endfunc
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
161 :catch
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
162 :$put =v:exception
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
163 :endtry
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
164 :"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
165 :" function name folowed by #
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
166 :try
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
167 :func! test2() "#
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
168 :echo "test2"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
169 :endfunc
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
170 :catch
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
171 :$put =v:exception
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
172 :endtry
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
173 :"
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
174 :" function name starting with/without "g:", buffer-local funcref.
5844
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
175 :function! g:Foo(n)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
176 : $put ='called Foo(' . a:n . ')'
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
177 :endfunction
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
178 :let b:my_func = function('Foo')
5844
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
179 :call b:my_func(1)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
180 :echo g:Foo(2)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
181 :echo Foo(3)
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
182 :"
5850
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
183 :" script-local function used in Funcref must exist.
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
184 :so test_eval_func.vim
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
185 :"
5858
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
186 :" Using $ instead of '$' must give an error
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
187 :try
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
188 : call append($, 'foobar')
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
189 :catch
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
190 :$put =v:exception
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
191 :endtry
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
192 :"
5944
332a5c2b2956 updated for version 7.4.313
Bram Moolenaar <bram@vim.org>
parents: 5938
diff changeset
193 :$put ='{{{1 getcurpos/setpos'
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
194 /^012345678
5944
332a5c2b2956 updated for version 7.4.313
Bram Moolenaar <bram@vim.org>
parents: 5938
diff changeset
195 6l:let sp = getcurpos()
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
196 0:call setpos('.', sp)
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
197 jyl:$put
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
198 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
199 :/^start:/+1,$wq! test.out
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
200 :" vim: et ts=4 isk-=\: fmr=???,???
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
201 :call getchar()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
202 ENDTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
203
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
204 012345678
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
205 012345678
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
206
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
207 start: