annotate src/testdir/test_ins_complete.vim @ 18892:fb2d26bc8ca1 v8.2.0007

patch 8.2.0007: popup menu positioned wrong with folding in two tabs Commit: https://github.com/vim/vim/commit/09dd2bb3364cc8fb5a8f2507bc2f4ceba481db3d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 14 18:42:15 2019 +0100 patch 8.2.0007: popup menu positioned wrong with folding in two tabs Problem: Popup menu positioned wrong with folding in two tabs. Solution: Update the cursor line height. (closes https://github.com/vim/vim/issues/5353)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Dec 2019 18:45:04 +0100
parents 1348696d07cd
children a9c47c623f4a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18892
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
1 source screendump.vim
17588
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
2 source check.vim
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Test for insert expansion
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_ins_complete()
12692
03a6aeea2096 patch 8.0.1224: still interference between test functions
Christian Brabandt <cb@256bit.org>
parents: 12686
diff changeset
6 edit test_ins_complete.vim
12788
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
7 " The files in the current directory interferes with the files
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
8 " used by this test. So use a separate directory for the test.
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
9 call mkdir('Xdir')
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
10 cd Xdir
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
11
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 set ff=unix
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call writefile(["test11\t36Gepeto\t/Tag/",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 \ "asd\ttest11file\t36G",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ "Makefile\tto\trun"], 'Xtestfile')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call writefile(['', 'start of testfile',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ 'ru',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ 'run1',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'run2',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'STARTTEST',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'ENDTEST',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ 'end of testfile'], 'Xtestdata')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 set ff&
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 edit Xtestdata
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 new
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call append(0, ['#include "Xtestfile"', ''])
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call cursor(2, 1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 set cot=
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 set cpt=.,w
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 " add-expands (word from next line) from other window
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 exe "normal iru\<C-N>\<C-N>\<C-X>\<C-N>\<Esc>\<C-A>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call assert_equal('run1 run3', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 " add-expands (current buffer first)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 exe "normal o\<C-P>\<C-X>\<C-N>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal('run3 run3', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 " Local expansion, ends in an empty line (unless it becomes a global
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 " expansion)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 exe "normal o\<C-X>\<C-P>\<C-P>\<C-P>\<C-P>\<C-P>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call assert_equal('', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 " starts Local and switches to global add-expansion
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 exe "normal o\<C-X>\<C-P>\<C-P>\<C-X>\<C-X>\<C-N>\<C-X>\<C-N>\<C-N>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call assert_equal('run1 run2', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 set cpt=.,w,i
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 " i-add-expands and switches to local
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 exe "normal OM\<C-N>\<C-X>\<C-N>\<C-X>\<C-N>\<C-X>\<C-X>\<C-X>\<C-P>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 call assert_equal("Makefile\tto\trun3", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 " add-expands lines (it would end in an empty line if it didn't ignored
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 " itself)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 exe "normal o\<C-X>\<C-L>\<C-X>\<C-L>\<C-P>\<C-P>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call assert_equal("Makefile\tto\trun3", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call assert_equal("Makefile\tto\trun3", getline(line('.') - 1))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 set cpt=kXtestfile
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 " checks k-expansion, and file expansion (use Xtest11 instead of test11,
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 " because TEST11.OUT may match first on DOS)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 write Xtest11.one
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 write Xtest11.two
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 exe "normal o\<C-N>\<Esc>IX\<Esc>A\<C-X>\<C-F>\<C-N>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 call assert_equal('Xtest11.two', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 " use CTRL-X CTRL-F to complete Xtest11.one, remove it and then use CTRL-X
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 " CTRL-F again to verify this doesn't cause trouble.
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 exe "normal oXt\<C-X>\<C-F>\<BS>\<BS>\<BS>\<BS>\<BS>\<BS>\<BS>\<BS>\<C-X>\<C-F>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 call assert_equal('Xtest11.one', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 normal ddk
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 set cpt=w
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 " checks make_cyclic in other window
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 exe "normal oST\<C-N>\<C-P>\<C-P>\<C-P>\<C-P>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 call assert_equal('STARTTEST', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 set cpt=u nohid
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 " checks unloaded buffer expansion
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 only
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 exe "normal oEN\<C-N>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 call assert_equal('ENDTEST', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 " checks adding mode abortion
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 exe "normal ounl\<C-N>\<C-X>\<C-X>\<C-P>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 call assert_equal('unless', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 set cpt=t,d def=^\\k* tags=Xtestfile notagbsearch
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 " tag expansion, define add-expansion interrupted
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 exe "normal o\<C-X>\<C-]>\<C-X>\<C-D>\<C-X>\<C-D>\<C-X>\<C-X>\<C-D>\<C-X>\<C-D>\<C-X>\<C-D>\<C-X>\<C-D>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 call assert_equal('test11file 36Gepeto /Tag/ asd', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 " t-expansion
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 exe "normal oa\<C-N>\<Esc>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 call assert_equal('asd', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 %bw!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 call delete('Xtestfile')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 call delete('Xtest11.one')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call delete('Xtest11.two')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 call delete('Xtestdata')
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 set cpt& cot& def& tags& tagbsearch& hidden&
12788
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
99 cd ..
cb9b2774f21f patch 8.0.1271: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents: 12728
diff changeset
100 call delete('Xdir', 'rf')
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 endfunc
12728
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
102
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
103 func Test_omni_dash()
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
104 func Omni(findstart, base)
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
105 if a:findstart
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
106 return 5
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
107 else
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
108 echom a:base
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
109 return ['-help', '-v']
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
110 endif
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
111 endfunc
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
112 set omnifunc=Omni
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
113 new
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
114 exe "normal Gofind -\<C-x>\<C-o>"
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
115 call assert_equal("\n-\nmatch 1 of 2", execute(':2mess'))
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
116
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
117 bwipe!
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
118 delfunc Omni
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
119 set omnifunc=
9c1659761fc3 patch 8.0.1242: function argument with only dash is seen as number zero
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
120 endfunc
13215
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
121
14071
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
122 func Test_completefunc_args()
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
123 let s:args = []
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
124 func! CompleteFunc(findstart, base)
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
125 let s:args += [[a:findstart, empty(a:base)]]
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
126 endfunc
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
127 new
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
128
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
129 set completefunc=CompleteFunc
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
130 call feedkeys("i\<C-X>\<C-U>\<Esc>", 'x')
14075
320956bddcef patch 8.1.0055: complete test has wrong order of arguments
Christian Brabandt <cb@256bit.org>
parents: 14071
diff changeset
131 call assert_equal([1, 1], s:args[0])
320956bddcef patch 8.1.0055: complete test has wrong order of arguments
Christian Brabandt <cb@256bit.org>
parents: 14071
diff changeset
132 call assert_equal(0, s:args[1][0])
14071
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
133 set completefunc=
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
134
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
135 let s:args = []
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
136 set omnifunc=CompleteFunc
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
137 call feedkeys("i\<C-X>\<C-O>\<Esc>", 'x')
14075
320956bddcef patch 8.1.0055: complete test has wrong order of arguments
Christian Brabandt <cb@256bit.org>
parents: 14071
diff changeset
138 call assert_equal([1, 1], s:args[0])
320956bddcef patch 8.1.0055: complete test has wrong order of arguments
Christian Brabandt <cb@256bit.org>
parents: 14071
diff changeset
139 call assert_equal(0, s:args[1][0])
14071
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
140 set omnifunc=
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
141
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
142 bwipe!
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
143 unlet s:args
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
144 delfunc CompleteFunc
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
145 endfunc
c1fcfafa8d1a patch 8.1.0053: first argument of 'completefunc' has inconsistent type
Christian Brabandt <cb@256bit.org>
parents: 13238
diff changeset
146
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
147 func s:CompleteDone_CompleteFuncNone( findstart, base )
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
148 if a:findstart
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
149 return 0
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
150 endif
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
151
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
152 return v:none
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
153 endfunc
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
154
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
155 func s:CompleteDone_CompleteFuncDict( findstart, base )
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
156 if a:findstart
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
157 return 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
158 endif
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
159
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
160 return {
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
161 \ 'words': [
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
162 \ {
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
163 \ 'word': 'aword',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
164 \ 'abbr': 'wrd',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
165 \ 'menu': 'extra text',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
166 \ 'info': 'words are cool',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
167 \ 'kind': 'W',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
168 \ 'user_data': 'test'
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
169 \ }
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
170 \ ]
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
171 \ }
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
172 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
173
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
174 func s:CompleteDone_CheckCompletedItemNone()
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
175 let s:called_completedone = 1
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
176 endfunc
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
177
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
178 func s:CompleteDone_CheckCompletedItemDict()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
179 call assert_equal( 'aword', v:completed_item[ 'word' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
180 call assert_equal( 'wrd', v:completed_item[ 'abbr' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
181 call assert_equal( 'extra text', v:completed_item[ 'menu' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
182 call assert_equal( 'words are cool', v:completed_item[ 'info' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
183 call assert_equal( 'W', v:completed_item[ 'kind' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
184 call assert_equal( 'test', v:completed_item[ 'user_data' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
185
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
186 let s:called_completedone = 1
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
187 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
188
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
189 func Test_CompleteDoneNone()
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
190 au CompleteDone * :call <SID>CompleteDone_CheckCompletedItemNone()
16270
749a7c03de8d patch 8.1.1139: no test for what is fixed in patch 8.1.0716
Bram Moolenaar <Bram@vim.org>
parents: 15416
diff changeset
191 let oldline = join(map(range(&columns), 'nr2char(screenchar(&lines-1, v:val+1))'), '')
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
192
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
193 set completefunc=<SID>CompleteDone_CompleteFuncNone
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
194 execute "normal a\<C-X>\<C-U>\<C-Y>"
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
195 set completefunc&
16270
749a7c03de8d patch 8.1.1139: no test for what is fixed in patch 8.1.0716
Bram Moolenaar <Bram@vim.org>
parents: 15416
diff changeset
196 let newline = join(map(range(&columns), 'nr2char(screenchar(&lines-1, v:val+1))'), '')
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
197
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
198 call assert_true(s:called_completedone)
16270
749a7c03de8d patch 8.1.1139: no test for what is fixed in patch 8.1.0716
Bram Moolenaar <Bram@vim.org>
parents: 15416
diff changeset
199 call assert_equal(oldline, newline)
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
200
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
201 let s:called_completedone = 0
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
202 au! CompleteDone
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
203 endfunc
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
204
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
205 func Test_CompleteDoneDict()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
206 au CompleteDone * :call <SID>CompleteDone_CheckCompletedItemDict()
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
207
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
208 set completefunc=<SID>CompleteDone_CompleteFuncDict
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
209 execute "normal a\<C-X>\<C-U>\<C-Y>"
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
210 set completefunc&
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
211
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
212 call assert_equal('test', v:completed_item[ 'user_data' ])
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
213 call assert_true(s:called_completedone)
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
214
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
215 let s:called_completedone = 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
216 au! CompleteDone
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
217 endfunc
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
218
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
219 func s:CompleteDone_CompleteFuncDictNoUserData(findstart, base)
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
220 if a:findstart
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
221 return 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
222 endif
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
223
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
224 return {
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
225 \ 'words': [
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
226 \ {
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
227 \ 'word': 'aword',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
228 \ 'abbr': 'wrd',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
229 \ 'menu': 'extra text',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
230 \ 'info': 'words are cool',
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
231 \ 'kind': 'W'
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
232 \ }
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
233 \ ]
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
234 \ }
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
235 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
236
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
237 func s:CompleteDone_CheckCompletedItemDictNoUserData()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
238 call assert_equal( 'aword', v:completed_item[ 'word' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
239 call assert_equal( 'wrd', v:completed_item[ 'abbr' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
240 call assert_equal( 'extra text', v:completed_item[ 'menu' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
241 call assert_equal( 'words are cool', v:completed_item[ 'info' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
242 call assert_equal( 'W', v:completed_item[ 'kind' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
243 call assert_equal( '', v:completed_item[ 'user_data' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
244
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
245 let s:called_completedone = 1
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
246 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
247
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
248 func Test_CompleteDoneDictNoUserData()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
249 au CompleteDone * :call <SID>CompleteDone_CheckCompletedItemDictNoUserData()
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
250
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
251 set completefunc=<SID>CompleteDone_CompleteFuncDictNoUserData
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
252 execute "normal a\<C-X>\<C-U>\<C-Y>"
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
253 set completefunc&
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
254
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
255 call assert_equal('', v:completed_item[ 'user_data' ])
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
256 call assert_true(s:called_completedone)
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
257
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
258 let s:called_completedone = 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
259 au! CompleteDone
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
260 endfunc
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
261
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
262 func s:CompleteDone_CompleteFuncList(findstart, base)
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
263 if a:findstart
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
264 return 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
265 endif
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
266
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
267 return [ 'aword' ]
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
268 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
269
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
270 func s:CompleteDone_CheckCompletedItemList()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
271 call assert_equal( 'aword', v:completed_item[ 'word' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
272 call assert_equal( '', v:completed_item[ 'abbr' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
273 call assert_equal( '', v:completed_item[ 'menu' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
274 call assert_equal( '', v:completed_item[ 'info' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
275 call assert_equal( '', v:completed_item[ 'kind' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
276 call assert_equal( '', v:completed_item[ 'user_data' ] )
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
277
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
278 let s:called_completedone = 1
15406
63b02fcf1361 patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents: 14489
diff changeset
279 endfunc
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
280
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
281 func Test_CompleteDoneList()
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
282 au CompleteDone * :call <SID>CompleteDone_CheckCompletedItemList()
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
283
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
284 set completefunc=<SID>CompleteDone_CompleteFuncList
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
285 execute "normal a\<C-X>\<C-U>\<C-Y>"
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
286 set completefunc&
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
287
15416
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
288 call assert_equal('', v:completed_item[ 'user_data' ])
5f8ddd2a7b92 patch 8.1.0716: get warning message when 'completefunc' returns nothing
Bram Moolenaar <Bram@vim.org>
parents: 15406
diff changeset
289 call assert_true(s:called_completedone)
13238
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
290
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
291 let s:called_completedone = 0
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
292 au! CompleteDone
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
293 endfunc
e0dcfd3dbb52 patch 8.0.1493: completion items cannot be annotated
Christian Brabandt <cb@256bit.org>
parents: 13215
diff changeset
294
14489
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
295 func Test_CompleteDone_undo()
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
296 au CompleteDone * call append(0, "prepend1")
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
297 new
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
298 call setline(1, ["line1", "line2"])
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
299 call feedkeys("Go\<C-X>\<C-N>\<CR>\<ESC>", "tx")
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
300 call assert_equal(["prepend1", "line1", "line2", "line1", ""],
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
301 \ getline(1, '$'))
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
302 undo
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
303 call assert_equal(["line1", "line2"], getline(1, '$'))
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
304 bwipe!
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
305 au! CompleteDone
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
306 endfunc
cda216729f9b patch 8.1.0258: not enough testing for the CompleteDone event
Christian Brabandt <cb@256bit.org>
parents: 14075
diff changeset
307
13215
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
308 " Check that when using feedkeys() typeahead does not interrupt searching for
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
309 " completions.
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
310 func Test_compl_feedkeys()
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
311 new
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
312 set completeopt=menuone,noselect
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
313 call feedkeys("ajump ju\<C-X>\<C-N>\<C-P>\<ESC>", "tx")
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
314 call assert_equal("jump jump", getline(1))
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
315 bwipe!
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
316 set completeopt&
ae5f855a64be patch 8.0.1482: using feedkeys() does not work to test completion
Christian Brabandt <cb@256bit.org>
parents: 12788
diff changeset
317 endfunc
17468
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
318
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
319 func Test_compl_in_cmdwin()
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
320 set wildmenu wildchar=<Tab>
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
321 com! -nargs=1 -complete=command GetInput let input = <q-args>
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
322 com! -buffer TestCommand echo 'TestCommand'
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
323
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
324 let input = ''
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
325 call feedkeys("q:iGetInput T\<C-x>\<C-v>\<CR>", 'tx!')
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
326 call assert_equal('TestCommand', input)
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
327
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
328 let input = ''
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
329 call feedkeys("q::GetInput T\<Tab>\<CR>:q\<CR>", 'tx!')
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
330 call assert_equal('T', input)
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
331
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
332 delcom TestCommand
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
333 delcom GetInput
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
334 set wildmenu& wildchar&
fa6c9047ec70 patch 8.1.1732: completion in cmdwin does not work for buffer-local commands
Bram Moolenaar <Bram@vim.org>
parents: 16270
diff changeset
335 endfunc
17543
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
336
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
337 " Test for insert path completion with completeslash option
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
338 func Test_ins_completeslash()
17588
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
339 CheckMSWindows
17543
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
340
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
341 call mkdir('Xdir')
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
342 let orig_shellslash = &shellslash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
343 set cpt&
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
344 new
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
345
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
346 set noshellslash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
347
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
348 set completeslash=
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
349 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
350 call assert_equal('Xdir\', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
351
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
352 set completeslash=backslash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
353 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
354 call assert_equal('Xdir\', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
355
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
356 set completeslash=slash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
357 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
358 call assert_equal('Xdir/', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
359
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
360 set shellslash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
361
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
362 set completeslash=
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
363 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
364 call assert_equal('Xdir/', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
365
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
366 set completeslash=backslash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
367 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
368 call assert_equal('Xdir\', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
369
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
370 set completeslash=slash
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
371 exe "normal oXd\<C-X>\<C-F>"
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
372 call assert_equal('Xdir/', getline('.'))
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
373 %bw!
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
374 call delete('Xdir', 'rf')
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
375
17588
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
376 set noshellslash
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
377 set completeslash=slash
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
378 call assert_true(stridx(globpath(&rtp, 'syntax/*.vim', 1, 1)[0], '\') != -1)
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
379
17543
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
380 let &shellslash = orig_shellslash
17588
1348696d07cd patch 8.1.1791: 'completeslash' also applies to globpath()
Bram Moolenaar <Bram@vim.org>
parents: 17553
diff changeset
381 set completeslash=
17543
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
382 endfunc
77c3f6428b6c patch 8.1.1769: 'shellslash' is also used for completion
Bram Moolenaar <Bram@vim.org>
parents: 17468
diff changeset
383
18892
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
384 func Test_pum_with_folds_two_tabs()
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
385 CheckScreendump
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
386
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
387 let lines =<< trim END
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
388 set fdm=marker
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
389 call setline(1, ['" x {{{1', '" a some text'])
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
390 call setline(3, range(&lines)->map({_, val -> '" a' .. val}))
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
391 norm! zm
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
392 tab sp
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
393 call feedkeys('2Gzv', 'xt')
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
394 call feedkeys("0fa", 'xt')
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
395 END
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
396
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
397 call writefile(lines, 'Xpumscript')
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
398 let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
399 call term_wait(buf, 100)
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
400 call term_sendkeys(buf, "a\<C-N>")
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
401 call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {})
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
402
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
403 call term_sendkeys(buf, "\<Esc>")
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
404 call StopVimInTerminal(buf)
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
405 call delete('Xpumscript')
fb2d26bc8ca1 patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Bram Moolenaar <Bram@vim.org>
parents: 17588
diff changeset
406 endfunc