Mercurial > vim
annotate src/testdir/test_cmdline.vim @ 16880:998603a243d7 v8.1.1441
patch 8.1.1441: popup window filter not yet implemented
commit https://github.com/vim/vim/commit/bf0eff0b724ebf4951f7ca82e6c648451f9f0c01
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 1 17:13:36 2019 +0200
patch 8.1.1441: popup window filter not yet implemented
Problem: Popup window filter not yet implemented.
Solution: Implement the popup filter.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jun 2019 17:15:06 +0200 |
parents | 1c8a90c4d2a1 |
children | 5cda6165a5c1 |
rev | line source |
---|---|
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for editing the command line. |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_complete_tab() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 call writefile(['testfile'], 'Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 call feedkeys(":e Xtest\t\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 call assert_equal('testfile', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call delete('Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 func Test_complete_list() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 " We can't see the output, but at least we check the code runs properly. |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call feedkeys(":e test\<C-D>\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal('test', expand('%:t')) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 func Test_complete_wildmenu() |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
17 call mkdir('Xdir1/Xdir2', 'p') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
18 call writefile(['testfile1'], 'Xdir1/Xtestfile1') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
19 call writefile(['testfile2'], 'Xdir1/Xtestfile2') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
20 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
21 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 set wildmenu |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
23 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
24 " Pressing <Tab> completes, and moves to next files when pressing again. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
25 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
26 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
27 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_equal('testfile2', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
30 " <S-Tab> is like <Tab> but begin with the last match and then go to |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
31 " previous. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
32 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
33 call assert_equal('testfile2', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
34 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
35 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
36 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
37 " <Left>/<Right> to move to previous/next file. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
38 call feedkeys(":e Xdir1/\<Tab>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
39 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
40 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
41 call assert_equal('testfile2', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
42 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
43 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
44 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
45 " <Up>/<Down> to go up/down directories. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
46 call feedkeys(":e Xdir1/\<Tab>\<Down>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
47 call assert_equal('testfile3', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
48 call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
49 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
50 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
51 " cleanup |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
52 %bwipe |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
53 call delete('Xdir1/Xdir2/Xtestfile4') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
54 call delete('Xdir1/Xdir2/Xtestfile3') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
55 call delete('Xdir1/Xtestfile2') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
56 call delete('Xdir1/Xtestfile1') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
57 call delete('Xdir1/Xdir2', 'd') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
58 call delete('Xdir1', 'd') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 set nowildmenu |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endfunc |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
61 |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
62 func Test_map_completion() |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
63 if !has('cmdline_compl') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
64 return |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
65 endif |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
66 call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
67 call assert_equal('"map <unique> <silent>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
68 call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
69 call assert_equal('"map <script> <unique>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
70 call feedkeys(":map <expr> <sc\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
71 call assert_equal('"map <expr> <script>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
72 call feedkeys(":map <buffer> <e\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
73 call assert_equal('"map <buffer> <expr>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
74 call feedkeys(":map <nowait> <b\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
75 call assert_equal('"map <nowait> <buffer>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
76 call feedkeys(":map <special> <no\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
77 call assert_equal('"map <special> <nowait>', getreg(':')) |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
78 call feedkeys(":map <silent> <sp\<Tab>\<Home>\"\<CR>", 'xt') |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
79 call assert_equal('"map <silent> <special>', getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
80 |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
81 map <Middle>x middle |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
82 |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
83 map ,f commaf |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
84 map ,g commaf |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
85 map <Left> left |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
86 map <A-Left>x shiftleft |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
87 call feedkeys(":map ,\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
88 call assert_equal('"map ,f', getreg(':')) |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
89 call feedkeys(":map ,\<Tab>\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
90 call assert_equal('"map ,g', getreg(':')) |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
91 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
92 call assert_equal('"map <Left>', getreg(':')) |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
93 call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt') |
16499
0f0de1fb70a2
patch 8.1.1253: mapping completion test fails
Bram Moolenaar <Bram@vim.org>
parents:
16497
diff
changeset
|
94 call assert_equal("\"map <A-Left>\<Tab>", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
95 unmap ,f |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
96 unmap ,g |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
97 unmap <Left> |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
98 unmap <A-Left>x |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
99 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
100 set cpo-=< cpo-=B cpo-=k |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
101 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
102 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
103 call assert_equal('"map <Left>', getreg(':')) |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
104 call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt') |
16499
0f0de1fb70a2
patch 8.1.1253: mapping completion test fails
Bram Moolenaar <Bram@vim.org>
parents:
16497
diff
changeset
|
105 call assert_equal("\"map <M\<Tab>", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
106 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
107 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
108 set cpo+=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
109 map <Left> left |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
110 exe "set t_k6=\<Esc>[17~" |
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
111 call feedkeys(":map \<Esc>[17~x f6x\<CR>", 'xt') |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
112 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
113 call assert_equal('"map <Left>', getreg(':')) |
16529
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
114 if !has('gui_running') |
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
115 call feedkeys(":map \<Esc>[17~\<Tab>\<Home>\"\<CR>", 'xt') |
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
116 call assert_equal("\"map <F6>x", getreg(':')) |
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
117 endif |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
118 unmap <Left> |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
119 call feedkeys(":unmap \<Esc>[17~x\<CR>", 'xt') |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
120 set cpo-=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
121 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
122 set cpo+=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
123 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
124 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
125 call assert_equal('"map <Left>', getreg(':')) |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
126 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
127 set cpo-=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
128 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
129 set cpo+=k |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
130 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
131 call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt') |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
132 call assert_equal('"map <Left>', getreg(':')) |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
133 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
134 set cpo-=k |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
135 |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
136 unmap <Middle>x |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
137 set cpo&vim |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
138 endfunc |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
139 |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
140 func Test_match_completion() |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
141 if !has('cmdline_compl') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
142 return |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
143 endif |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
144 hi Aardig ctermfg=green |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
145 call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
146 call assert_equal('"match Aardig', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
147 call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
148 call assert_equal('"match none', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
149 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
150 |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
151 func Test_highlight_completion() |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
152 if !has('cmdline_compl') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
153 return |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
154 endif |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
155 hi Aardig ctermfg=green |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
156 call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
157 call assert_equal('"hi Aardig', getreg(':')) |
11354
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
158 call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt') |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
159 call assert_equal('"hi default Aardig', getreg(':')) |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
160 call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt') |
129077fb57e6
patch 8.0.0562: not enough test coverage for syntax commands
Christian Brabandt <cb@256bit.org>
parents:
11323
diff
changeset
|
161 call assert_equal('"hi clear Aardig', getreg(':')) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
162 call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
163 call assert_equal('"hi link', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
164 call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
165 call assert_equal('"hi default', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
166 call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
167 call assert_equal('"hi clear', getreg(':')) |
11254
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
168 |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
169 " A cleared group does not show up in completions. |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
170 hi Anders ctermfg=green |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
171 call assert_equal(['Aardig', 'Anders'], getcompletion('A', 'highlight')) |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
172 hi clear Aardig |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
173 call assert_equal(['Anders'], getcompletion('A', 'highlight')) |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
174 hi clear Anders |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
175 call assert_equal([], getcompletion('A', 'highlight')) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
176 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
177 |
10656
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
178 func Test_expr_completion() |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
179 if !has('cmdline_compl') |
10656
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
180 return |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
181 endif |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
182 for cmd in [ |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
183 \ 'let a = ', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
184 \ 'if', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
185 \ 'elseif', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
186 \ 'while', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
187 \ 'for', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
188 \ 'echo', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
189 \ 'echon', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
190 \ 'execute', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
191 \ 'echomsg', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
192 \ 'echoerr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
193 \ 'call', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
194 \ 'return', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
195 \ 'cexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
196 \ 'caddexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
197 \ 'cgetexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
198 \ 'lexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
199 \ 'laddexpr', |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
200 \ 'lgetexpr'] |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
201 call feedkeys(":" . cmd . " getl\<Tab>\<Home>\"\<CR>", 'xt') |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
202 call assert_equal('"' . cmd . ' getline(', getreg(':')) |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
203 endfor |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
204 endfunc |
4762bd300564
patch 8.0.0218: no completion for :cexpr and similar commands
Christian Brabandt <cb@256bit.org>
parents:
10480
diff
changeset
|
205 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
206 func Test_getcompletion() |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
207 if !has('cmdline_compl') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
208 return |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
209 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
210 let groupcount = len(getcompletion('', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
211 call assert_true(groupcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
212 let matchcount = len(getcompletion('File', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
213 call assert_true(matchcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
214 call assert_true(groupcount > matchcount) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
215 |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
216 if has('menu') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
217 source $VIMRUNTIME/menu.vim |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
218 let matchcount = len(getcompletion('', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
219 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
220 call assert_equal(['File.'], getcompletion('File', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
221 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
222 let matchcount = len(getcompletion('File.', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
223 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
224 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
225 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
226 let l = getcompletion('v:n', 'var') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
227 call assert_true(index(l, 'v:null') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
228 let l = getcompletion('v:notexists', 'var') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
229 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
230 |
13551
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
231 args a.c b.c |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
232 let l = getcompletion('', 'arglist') |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
233 call assert_equal(['a.c', 'b.c'], l) |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
234 %argdelete |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
235 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
236 let l = getcompletion('', 'augroup') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
237 call assert_true(index(l, 'END') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
238 let l = getcompletion('blahblah', 'augroup') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
239 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
240 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
241 let l = getcompletion('', 'behave') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
242 call assert_true(index(l, 'mswin') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
243 let l = getcompletion('not', 'behave') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
244 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
245 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
246 let l = getcompletion('', 'color') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
247 call assert_true(index(l, 'default') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
248 let l = getcompletion('dirty', 'color') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
249 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
250 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
251 let l = getcompletion('', 'command') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
252 call assert_true(index(l, 'sleep') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
253 let l = getcompletion('awake', 'command') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
254 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
255 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
256 let l = getcompletion('', 'dir') |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
257 call assert_true(index(l, 'samples/') >= 0) |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
258 let l = getcompletion('NoMatch', 'dir') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
259 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
260 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
261 let l = getcompletion('exe', 'expression') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
262 call assert_true(index(l, 'executable(') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
263 let l = getcompletion('kill', 'expression') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
264 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
265 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
266 let l = getcompletion('tag', 'function') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
267 call assert_true(index(l, 'taglist(') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
268 let l = getcompletion('paint', 'function') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
269 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
270 |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
271 let Flambda = {-> 'hello'} |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
272 let l = getcompletion('', 'function') |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
273 let l = filter(l, {i, v -> v =~ 'lambda'}) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
274 call assert_equal([], l) |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
275 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
276 let l = getcompletion('run', 'file') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
277 call assert_true(index(l, 'runtest.vim') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
278 let l = getcompletion('walk', 'file') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
279 call assert_equal([], l) |
9861
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
280 set wildignore=*.vim |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
281 let l = getcompletion('run', 'file', 1) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
282 call assert_true(index(l, 'runtest.vim') < 0) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
283 set wildignore& |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
284 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
285 let l = getcompletion('ha', 'filetype') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
286 call assert_true(index(l, 'hamster') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
287 let l = getcompletion('horse', 'filetype') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
288 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
289 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
290 let l = getcompletion('z', 'syntax') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
291 call assert_true(index(l, 'zimbu') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
292 let l = getcompletion('emacs', 'syntax') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
293 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
294 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
295 let l = getcompletion('jikes', 'compiler') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
296 call assert_true(index(l, 'jikes') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
297 let l = getcompletion('break', 'compiler') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
298 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
299 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
300 let l = getcompletion('last', 'help') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
301 call assert_true(index(l, ':tablast') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
302 let l = getcompletion('giveup', 'help') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
303 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
304 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
305 let l = getcompletion('time', 'option') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
306 call assert_true(index(l, 'timeoutlen') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
307 let l = getcompletion('space', 'option') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
308 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
309 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
310 let l = getcompletion('er', 'highlight') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
311 call assert_true(index(l, 'ErrorMsg') >= 0) |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
312 let l = getcompletion('dark', 'highlight') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
313 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
314 |
10275
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
315 let l = getcompletion('', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
316 call assert_true(index(l, 'clear') >= 0) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
317 let l = getcompletion('not', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
318 call assert_equal([], l) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
319 |
11995
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
320 let l = getcompletion('', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
321 call assert_true(index(l, '<buffer>') >= 0) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
322 let l = getcompletion('not', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
323 call assert_equal([], l) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
324 |
13998
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
325 let l = getcompletion('.', 'shellcmd') |
14417
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
326 call assert_equal(['./', '../'], filter(l, 'v:val =~ "\\./"')) |
13998
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
327 call assert_equal(-1, match(l[2:], '^\.\.\?/$')) |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
328 let root = has('win32') ? 'C:\\' : '/' |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
329 let l = getcompletion(root, 'shellcmd') |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
330 let expected = map(filter(glob(root . '*', 0, 1), |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
331 \ 'isdirectory(v:val) || executable(v:val)'), 'isdirectory(v:val) ? v:val . ''/'' : v:val') |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
332 call assert_equal(expected, l) |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
333 |
9766
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
334 if has('cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
335 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
336 let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
337 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
338 " using cmdline completion must not change the result |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
339 call feedkeys(":cscope find \<c-d>\<c-c>", 'xt') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
340 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
341 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
342 let keys = ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't'] |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
343 let l = getcompletion('find ', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
344 call assert_equal(keys, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
345 endif |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
346 |
9774
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
347 if has('signs') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
348 sign define Testing linehl=Comment |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
349 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
350 let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace'] |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
351 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
352 " using cmdline completion must not change the result |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
353 call feedkeys(":sign list \<c-d>\<c-c>", 'xt') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
354 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
355 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
356 let l = getcompletion('list ', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
357 call assert_equal(['Testing'], l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
358 endif |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
359 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
360 " For others test if the name is recognized. |
13998
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
361 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user'] |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
362 if has('cmdline_hist') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
363 call add(names, 'history') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
364 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
365 if has('gettext') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
366 call add(names, 'locale') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
367 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
368 if has('profile') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
369 call add(names, 'syntime') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
370 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
371 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
372 set tags=Xtags |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
373 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
374 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
375 for name in names |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
376 let matchcount = len(getcompletion('', name)) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
377 call assert_true(matchcount >= 0, 'No matches for ' . name) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
378 endfor |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
379 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
380 call delete('Xtags') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
381 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
382 call assert_fails('call getcompletion("", "burp")', 'E475:') |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
383 endfunc |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
384 |
14417
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
385 func Test_shellcmd_completion() |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
386 let save_path = $PATH |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
387 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
388 call mkdir('Xpathdir/Xpathsubdir', 'p') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
389 call writefile([''], 'Xpathdir/Xfile.exe') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
390 call setfperm('Xpathdir/Xfile.exe', 'rwx------') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
391 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
392 " Set PATH to example directory without trailing slash. |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
393 let $PATH = getcwd() . '/Xpathdir' |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
394 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
395 " Test for the ":!<TAB>" case. Previously, this would include subdirs of |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
396 " dirs in the PATH, even though they won't be executed. We check that only |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
397 " subdirs of the PWD and executables from the PATH are included in the |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
398 " suggestions. |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
399 let actual = getcompletion('X', 'shellcmd') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
400 let expected = map(filter(glob('*', 0, 1), 'isdirectory(v:val) && v:val[0] == "X"'), 'v:val . "/"') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
401 call insert(expected, 'Xfile.exe') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
402 call assert_equal(expected, actual) |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
403 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
404 call delete('Xpathdir', 'rf') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
405 let $PATH = save_path |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
406 endfunc |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
407 |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
408 func Test_expand_star_star() |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
409 call mkdir('a/b', 'p') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
410 call writefile(['asdfasdf'], 'a/b/fileXname') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
411 call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
412 call assert_equal('find a/b/fileXname', getreg(':')) |
10007
a4d4ee212dab
commit https://github.com/vim/vim/commit/1773ddfdcd106fa3bbf479c9b62ccde03c2a86ba
Christian Brabandt <cb@256bit.org>
parents:
10002
diff
changeset
|
413 bwipe! |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
414 call delete('a', 'rf') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
415 endfunc |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
416 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
417 func Test_paste_in_cmdline() |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
418 let @a = "def" |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
419 call feedkeys(":abc \<C-R>a ghi\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
420 call assert_equal('"abc def ghi', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
421 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
422 new |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
423 call setline(1, 'asdf.x /tmp/some verylongword a;b-c*d ') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
424 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
425 call feedkeys(":aaa \<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
426 call assert_equal('"aaa asdf bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
427 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
428 call feedkeys("ft:aaa \<C-R>\<C-F> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
429 call assert_equal('"aaa /tmp/some bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
430 |
13831
1f95ec5de238
patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents:
13600
diff
changeset
|
431 call feedkeys(":aaa \<C-R>\<C-L> bbb\<C-B>\"\<CR>", 'tx') |
1f95ec5de238
patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents:
13600
diff
changeset
|
432 call assert_equal('"aaa '.getline(1).' bbb', @:) |
1f95ec5de238
patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents:
13600
diff
changeset
|
433 |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
434 set incsearch |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
435 call feedkeys("fy:aaa veryl\<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
436 call assert_equal('"aaa verylongword bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
437 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
438 call feedkeys("f;:aaa \<C-R>\<C-A> bbb\<C-B>\"\<CR>", 'tx') |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
439 call assert_equal('"aaa a;b-c*d bbb', @:) |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
440 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
441 call feedkeys(":\<C-\>etoupper(getline(1))\<CR>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
442 call assert_equal('"ASDF.X /TMP/SOME VERYLONGWORD A;B-C*D ', @:) |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
443 bwipe! |
13600
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
444 |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
445 " Error while typing a command used to cause that it was not executed |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
446 " in the end. |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
447 new |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
448 try |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
449 call feedkeys(":file \<C-R>%Xtestfile\<CR>", 'tx') |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
450 catch /^Vim\%((\a\+)\)\=:E32/ |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
451 " ignore error E32 |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
452 endtry |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
453 call assert_equal("Xtestfile", bufname("%")) |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
454 bwipe! |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
455 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
456 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
457 func Test_remove_char_in_cmdline() |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
458 call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
459 call assert_equal('"abc ef', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
460 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
461 call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
462 call assert_equal('"abcdef', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
463 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
464 call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
465 call assert_equal('"abc ghi', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
466 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
467 call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx') |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
468 call assert_equal('"def', @:) |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
469 endfunc |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
470 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
471 func Test_illegal_address1() |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
472 new |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
473 2;'( |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
474 2;') |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
475 quit |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
476 endfunc |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
477 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
478 func Test_illegal_address2() |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
479 call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
480 new |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
481 source Xtest.vim |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
482 " Trigger calling validate_cursor() |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
483 diffsp Xtest.vim |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
484 quit! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
485 bwipe! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
486 call delete('Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
487 endfunc |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
488 |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
489 func Test_cmdline_complete_wildoptions() |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
490 help |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
491 call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
492 let a = join(sort(split(@:)),' ') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
493 set wildoptions=tagfile |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
494 call feedkeys(":tag /\<c-a>\<c-b>\"\<cr>", 'tx') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
495 let b = join(sort(split(@:)),' ') |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
496 call assert_equal(a, b) |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
497 bw! |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
498 endfunc |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
499 |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
500 func Test_cmdline_complete_user_cmd() |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
501 command! -complete=color -nargs=1 Foo : |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
502 call feedkeys(":Foo \<Tab>\<Home>\"\<cr>", 'tx') |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
503 call assert_equal('"Foo blue', @:) |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
504 call feedkeys(":Foo b\<Tab>\<Home>\"\<cr>", 'tx') |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
505 call assert_equal('"Foo blue', @:) |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
506 delcommand Foo |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
507 endfunc |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
508 |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
509 func Test_cmdline_complete_user_names() |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
510 if has('unix') && executable('whoami') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
511 let whoami = systemlist('whoami')[0] |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
512 let first_letter = whoami[0] |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
513 if len(first_letter) > 0 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
514 " Trying completion of :e ~x where x is the first letter of |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
515 " the user name should complete to at least the user name. |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
516 call feedkeys(':e ~' . first_letter . "\<c-a>\<c-B>\"\<cr>", 'tx') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
517 call assert_match('^"e \~.*\<' . whoami . '\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
518 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
519 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
520 if has('win32') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
521 " Just in case: check that the system has an Administrator account. |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
522 let names = system('net user') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
523 if names =~ 'Administrator' |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
524 " Trying completion of :e ~A should complete to Administrator. |
15657
c2c4fb3379e8
patch 8.1.0836: user completion test can fail on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
525 " There could be other names starting with "A" before Administrator. |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
526 call feedkeys(':e ~A' . "\<c-a>\<c-B>\"\<cr>", 'tx') |
15657
c2c4fb3379e8
patch 8.1.0836: user completion test can fail on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
527 call assert_match('^"e \~.*Administrator', @:) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
528 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
529 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
530 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
531 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
532 funct Test_cmdline_complete_languages() |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
533 let lang = substitute(execute('language messages'), '.*"\(.*\)"$', '\1', '') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
534 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
535 call feedkeys(":language \<c-a>\<c-b>\"\<cr>", 'tx') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
536 call assert_match('^"language .*\<ctype\>.*\<messages\>.*\<time\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
537 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
538 if has('unix') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
539 " TODO: these tests don't work on Windows. lang appears to be 'C' |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
540 " but C does not appear in the completion. Why? |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
541 call assert_match('^"language .*\<' . lang . '\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
542 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
543 call feedkeys(":language messages \<c-a>\<c-b>\"\<cr>", 'tx') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
544 call assert_match('^"language .*\<' . lang . '\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
545 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
546 call feedkeys(":language ctype \<c-a>\<c-b>\"\<cr>", 'tx') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
547 call assert_match('^"language .*\<' . lang . '\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
548 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
549 call feedkeys(":language time \<c-a>\<c-b>\"\<cr>", 'tx') |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
550 call assert_match('^"language .*\<' . lang . '\>', @:) |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
551 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
552 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
553 |
12706
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
554 func Test_cmdline_write_alternatefile() |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
555 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
556 call setline('.', ['one', 'two']) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
557 f foo.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
558 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
559 f #-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
560 call assert_equal('foo.txt-A', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
561 f #<-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
562 call assert_equal('foo-B.txt', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
563 f %< |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
564 call assert_equal('foo-B', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
565 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
566 call assert_fails('f #<', 'E95') |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
567 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
568 f foo-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
569 f %<-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
570 call assert_equal('foo-B-A', expand('%')) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
571 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
572 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
573 endfunc |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
574 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
575 " using a leading backslash here |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
576 set cpo+=C |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
577 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
578 func Test_cmdline_search_range() |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
579 new |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
580 call setline(1, ['a', 'b', 'c', 'd']) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
581 /d |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
582 1,\/s/b/B/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
583 call assert_equal('B', getline(2)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
584 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
585 /a |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
586 $ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
587 \?,4s/c/C/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
588 call assert_equal('C', getline(3)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
589 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
590 call setline(1, ['a', 'b', 'c', 'd']) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
591 %s/c/c/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
592 1,\&s/b/B/ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
593 call assert_equal('B', getline(2)) |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
594 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
595 bwipe! |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
596 endfunc |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
597 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
598 " Tests for getcmdline(), getcmdpos() and getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
599 func Check_cmdline(cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
600 call assert_equal('MyCmd a', getcmdline()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
601 call assert_equal(8, getcmdpos()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
602 call assert_equal(a:cmdtype, getcmdtype()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
603 return '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
604 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
605 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
606 func Test_getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
607 call feedkeys(":MyCmd a\<C-R>=Check_cmdline(':')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
608 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
609 let cmdtype = '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
610 debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
611 call feedkeys(":debug echo 'test'\<CR>", "t") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
612 call feedkeys("let cmdtype = \<C-R>=string(getcmdtype())\<CR>\<CR>", "t") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
613 call feedkeys("cont\<CR>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
614 0debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
615 call assert_equal('>', cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
616 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
617 call feedkeys("/MyCmd a\<C-R>=Check_cmdline('/')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
618 call feedkeys("?MyCmd a\<C-R>=Check_cmdline('?')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
619 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
620 call feedkeys(":call input('Answer?')\<CR>", "t") |
10867
9a5a4b36a1c1
patch 8.0.0323: one second pause when running cmdline test
Christian Brabandt <cb@256bit.org>
parents:
10849
diff
changeset
|
621 call feedkeys("MyCmd a\<C-R>=Check_cmdline('@')\<CR>\<C-C>", "xt") |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
622 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
623 call feedkeys(":insert\<CR>MyCmd a\<C-R>=Check_cmdline('-')\<CR>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
624 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
625 cnoremap <expr> <F6> Check_cmdline('=') |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
626 call feedkeys("a\<C-R>=MyCmd a\<F6>\<Esc>\<Esc>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
627 cunmap <F6> |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
628 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
629 |
14167
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
630 func Test_getcmdwintype() |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
631 call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
632 call assert_equal('/', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
633 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
634 call feedkeys("q?:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
635 call assert_equal('?', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
636 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
637 call feedkeys("q::let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
638 call assert_equal(':', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
639 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
640 call feedkeys(":\<C-F>:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
641 call assert_equal(':', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
642 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
643 call assert_equal('', getcmdwintype()) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
644 endfunc |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
645 |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
646 func Test_verbosefile() |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
647 set verbosefile=Xlog |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
648 echomsg 'foo' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
649 echomsg 'bar' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
650 set verbosefile= |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
651 let log = readfile('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
652 call assert_match("foo\nbar", join(log, "\n")) |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
653 call delete('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
654 endfunc |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
655 |
13890
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
656 func Test_setcmdpos() |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
657 func InsertTextAtPos(text, pos) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
658 call assert_equal(0, setcmdpos(a:pos)) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
659 return a:text |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
660 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
661 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
662 " setcmdpos() with position in the middle of the command line. |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
663 call feedkeys(":\"12\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt') |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
664 call assert_equal('"1ab2', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
665 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
666 call feedkeys(":\"12\<C-R>\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt') |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
667 call assert_equal('"1b2a', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
668 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
669 " setcmdpos() with position beyond the end of the command line. |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
670 call feedkeys(":\"12\<C-B>\<C-R>=InsertTextAtPos('a', 10)\<CR>b\<CR>", 'xt') |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
671 call assert_equal('"12ab', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
672 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
673 " setcmdpos() returns 1 when not editing the command line. |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
674 call assert_equal(1, setcmdpos(3)) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
675 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
676 |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
677 func Test_cmdline_overstrike() |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
678 let encodings = ['latin1', 'utf8'] |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
679 let encoding_save = &encoding |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
680 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
681 for e in encodings |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
682 exe 'set encoding=' . e |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
683 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
684 " Test overstrike in the middle of the command line. |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
685 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
686 call assert_equal('"0ab1cd4', @:) |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
687 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
688 " Test overstrike going beyond end of command line. |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
689 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cdefgh\<enter>", 'xt') |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
690 call assert_equal('"0ab1cdefgh', @:) |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
691 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
692 " Test toggling insert/overstrike a few times. |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
693 call feedkeys(":\"01234\<home>\<right>ab\<right>\<insert>cd\<right>\<insert>ef\<enter>", 'xt') |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
694 call assert_equal('"ab0cd3ef4', @:) |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
695 endfor |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
696 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
697 " Test overstrike with multi-byte characters. |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
698 call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
699 call assert_equal('"テabキcdエディタ', @:) |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
700 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
701 let &encoding = encoding_save |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
702 endfunc |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
703 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
704 set cpo& |