annotate src/testdir/test76.in @ 7046:fd409a0800fd v7.4.836

commit https://github.com/vim/vim/commit/0a38dd29d6f65aa601162542a5ab0ba7f308fc8e Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 25 16:49:01 2015 +0200 patch 7.4.836 Problem: Accessing unitinialized memory. Solution: Add missing calls to init_tv(). (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Tue, 25 Aug 2015 17:20:28 +0200
parents 1c4ec9ed71ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2635
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 Tests for completefunc/omnifunc. vim: set ft=vim :
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 STARTTEST
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 :"Test that nothing happens if the 'completefunc' opens
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :"a new window (no completion, no crash)
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 :so small.vim
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :function! DummyCompleteOne(findstart, base)
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 : if a:findstart
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 : return 0
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 : else
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 : wincmd n
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 : return ['onedef', 'oneDEF']
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 : endif
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 :endfunction
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 :setlocal completefunc=DummyCompleteOne
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 /^one
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 A:q!
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :function! DummyCompleteTwo(findstart, base)
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 : if a:findstart
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 : wincmd n
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 : return 0
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 : else
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 : return ['twodef', 'twoDEF']
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 : endif
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 :endfunction
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 :setlocal completefunc=DummyCompleteTwo
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 /^two
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 A:q!
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 :"Test that 'completefunc' works when it's OK.
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 :function! DummyCompleteThree(findstart, base)
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 : if a:findstart
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 : return 0
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 : else
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 : return ['threedef', 'threeDEF']
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 : endif
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 :endfunction
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 :setlocal completefunc=DummyCompleteThree
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 /^three
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 A:/^+++/,/^three/w! test.out
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 :qa!
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 ENDTEST
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 +++
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 one
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 two
1c4ec9ed71ca updated for version 7.3.056
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 three