Mercurial > vim
annotate src/testdir/test_cmdline.vim @ 31984:479c93ad4a3b v9.0.1324
patch 9.0.1324: "gj" and "gk" do not move correctly over a closed fold
Commit: https://github.com/vim/vim/commit/441a7a94482f704b66253b8d08130f27b6b13736
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Sat Feb 18 20:15:44 2023 +0000
patch 9.0.1324: "gj" and "gk" do not move correctly over a closed fold
Problem: "gj" and "gk" do not move correctly over a closed fold.
Solution: Use the same code as used for "j"/"k" to go to the next/previous
line. (Luuk van Baal, closes #12007)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Feb 2023 21:30:03 +0100 |
parents | 3f39349c5107 |
children | a5b5d8df5763 |
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 |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
3 source check.vim |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
4 source screendump.vim |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
5 source view_util.vim |
20741
fa6f1c97813f
patch 8.2.0923: cmdline test is slow
Bram Moolenaar <Bram@vim.org>
parents:
20737
diff
changeset
|
6 source shared.vim |
28107
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
7 import './vim9.vim' as v9 |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
8 |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
9 func SetUp() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
10 func SaveLastScreenLine() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
11 let g:Sline = Screenline(&lines - 1) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
12 return '' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
13 endfunc |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
14 cnoremap <expr> <F4> SaveLastScreenLine() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
15 endfunc |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
16 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
17 func TearDown() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
18 delfunc SaveLastScreenLine |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
19 cunmap <F4> |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
20 endfunc |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
21 |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 func Test_complete_tab() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
23 call writefile(['testfile'], 'Xtestfile', 'D') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call feedkeys(":e Xtest\t\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal('testfile', getline(1)) |
25684
ba9d587f0b29
patch 8.2.3378: MS-Windows: completing environment variables with % is wrong
Bram Moolenaar <Bram@vim.org>
parents:
25682
diff
changeset
|
26 |
ba9d587f0b29
patch 8.2.3378: MS-Windows: completing environment variables with % is wrong
Bram Moolenaar <Bram@vim.org>
parents:
25682
diff
changeset
|
27 " Pressing <Tab> after '%' completes the current file, also on MS-Windows |
ba9d587f0b29
patch 8.2.3378: MS-Windows: completing environment variables with % is wrong
Bram Moolenaar <Bram@vim.org>
parents:
25682
diff
changeset
|
28 call feedkeys(":e %\t\r", "tx") |
ba9d587f0b29
patch 8.2.3378: MS-Windows: completing environment variables with % is wrong
Bram Moolenaar <Bram@vim.org>
parents:
25682
diff
changeset
|
29 call assert_equal('e Xtestfile', @:) |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 func Test_complete_list() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 " 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
|
34 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
|
35 call assert_equal('test', expand('%:t')) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
36 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
37 " If a command doesn't support completion, then CTRL-D should be literally |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
38 " used. |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
39 call feedkeys(":chistory \<C-D>\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
40 call assert_equal("\"chistory \<C-D>", @:) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
41 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
42 " Test for displaying the tail of the completion matches |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
43 set wildmode=longest,full |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
44 call mkdir('Xtest', 'R') |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
45 call writefile([], 'Xtest/a.c') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
46 call writefile([], 'Xtest/a.h') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
47 let g:Sline = '' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
48 call feedkeys(":e Xtest/\<C-D>\<F4>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
49 call assert_equal('a.c a.h', g:Sline) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
50 call assert_equal('"e Xtest/', @:) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
51 if has('win32') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
52 " Test for 'completeslash' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
53 set completeslash=backslash |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
54 call feedkeys(":e Xtest\<Tab>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
55 call assert_equal('"e Xtest\', @:) |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
56 call feedkeys(":e Xtest/\<Tab>\<C-B>\"\<CR>", 'xt') |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
57 call assert_equal('"e Xtest\a.', @:) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
58 set completeslash=slash |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
59 call feedkeys(":e Xtest\<Tab>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
60 call assert_equal('"e Xtest/', @:) |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
61 call feedkeys(":e Xtest\\\<Tab>\<C-B>\"\<CR>", 'xt') |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
62 call assert_equal('"e Xtest/a.', @:) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
63 set completeslash& |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
64 endif |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
65 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
66 " Test for displaying the tail with wildcards |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
67 let g:Sline = '' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
68 call feedkeys(":e Xtes?/\<C-D>\<F4>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
69 call assert_equal('Xtest/a.c Xtest/a.h', g:Sline) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
70 call assert_equal('"e Xtes?/', @:) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
71 let g:Sline = '' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
72 call feedkeys(":e Xtes*/\<C-D>\<F4>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
73 call assert_equal('Xtest/a.c Xtest/a.h', g:Sline) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
74 call assert_equal('"e Xtes*/', @:) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
75 let g:Sline = '' |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
76 call feedkeys(":e Xtes[/\<C-D>\<F4>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
77 call assert_equal(':e Xtes[/', g:Sline) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
78 call assert_equal('"e Xtes[/', @:) |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
79 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
80 set wildmode& |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 func Test_complete_wildmenu() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
84 call mkdir('Xwilddir1/Xdir2', 'pR') |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
85 call writefile(['testfile1'], 'Xwilddir1/Xtestfile1') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
86 call writefile(['testfile2'], 'Xwilddir1/Xtestfile2') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
87 call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile3') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
88 call writefile(['testfile3'], 'Xwilddir1/Xdir2/Xtestfile4') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 set wildmenu |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
90 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
91 " Pressing <Tab> completes, and moves to next files when pressing again. |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
92 call feedkeys(":e Xwilddir1/\<Tab>\<Tab>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
93 call assert_equal('testfile1', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
94 call feedkeys(":e Xwilddir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 call assert_equal('testfile2', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
97 " <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
|
98 " previous. |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
99 call feedkeys(":e Xwilddir1/Xtest\<S-Tab>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
100 call assert_equal('testfile2', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
101 call feedkeys(":e Xwilddir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
102 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
|
103 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
104 " <Left>/<Right> to move to previous/next file. |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
105 call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
106 call assert_equal('testfile1', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
107 call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<Right>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
108 call assert_equal('testfile2', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
109 call feedkeys(":e Xwilddir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
110 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
|
111 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
112 " <Up>/<Down> to go up/down directories. |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
113 call feedkeys(":e Xwilddir1/\<Tab>\<Down>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
114 call assert_equal('testfile3', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
115 call feedkeys(":e Xwilddir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
116 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
|
117 |
23382
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
118 " this fails in some Unix GUIs, not sure why |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
119 if !has('unix') || !has('gui_running') |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
120 " <C-J>/<C-K> mappings to go up/down directories when 'wildcharm' is |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
121 " different than 'wildchar'. |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
122 set wildcharm=<C-Z> |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
123 cnoremap <C-J> <Down><C-Z> |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
124 cnoremap <C-K> <Up><C-Z> |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
125 call feedkeys(":e Xwilddir1/\<Tab>\<C-J>\<CR>", 'tx') |
23382
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
126 call assert_equal('testfile3', getline(1)) |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
127 call feedkeys(":e Xwilddir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx') |
23382
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
128 call assert_equal('testfile1', getline(1)) |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
129 set wildcharm=0 |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
130 cunmap <C-J> |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
131 cunmap <C-K> |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
132 endif |
23356
32a9d01c2a49
patch 8.2.2221: if <Down> is mapped on the command line 'wildchar' is inserted
Bram Moolenaar <Bram@vim.org>
parents:
23322
diff
changeset
|
133 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
134 " Test for canceling the wild menu by adding a character |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
135 redrawstatus |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
136 call feedkeys(":e Xwilddir1/\<Tab>x\<C-B>\"\<CR>", 'xt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
137 call assert_equal('"e Xwilddir1/Xdir2/x', @:) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
138 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
139 " Completion using a relative path |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
140 cd Xwilddir1/Xdir2 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
141 call feedkeys(":e ../\<Tab>\<Right>\<Down>\<C-A>\<C-B>\"\<CR>", 'tx') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
142 call assert_equal('"e Xtestfile3 Xtestfile4', @:) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
143 cd - |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
144 |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
145 " test for wildmenumode() |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
146 cnoremap <expr> <F2> wildmenumode() |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
147 call feedkeys(":cd Xwilddir\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
148 call assert_equal('"cd Xwilddir1/0', @:) |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
149 call feedkeys(":e Xwilddir1/\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
150 call assert_equal('"e Xwilddir1/Xdir2/1', @:) |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
151 cunmap <F2> |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
152 |
28109
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
153 " Test for canceling the wild menu by pressing <PageDown> or <PageUp>. |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
154 " After this pressing <Left> or <Right> should not change the selection. |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
155 call feedkeys(":sign \<Tab>\<PageDown>\<Left>\<Right>\<C-A>\<C-B>\"\<CR>", 'tx') |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
156 call assert_equal('"sign define', @:) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
157 call histadd('cmd', 'TestWildMenu') |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
158 call feedkeys(":sign \<Tab>\<PageUp>\<Left>\<Right>\<C-A>\<C-B>\"\<CR>", 'tx') |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
159 call assert_equal('"TestWildMenu', @:) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
160 |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
161 " cleanup |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
162 %bwipe |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 set nowildmenu |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 endfunc |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
165 |
22061
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
166 func Test_wildmenu_screendump() |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
167 CheckScreendump |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
168 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
169 let lines =<< trim [SCRIPT] |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
170 set wildmenu hlsearch |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
171 [SCRIPT] |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
172 call writefile(lines, 'XTest_wildmenu', 'D') |
22061
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
173 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
174 let buf = RunVimInTerminal('-S XTest_wildmenu', {'rows': 8}) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
175 call term_sendkeys(buf, ":vim\<Tab>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
176 call VerifyScreenDump(buf, 'Test_wildmenu_1', {}) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
177 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
178 call term_sendkeys(buf, "\<Tab>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
179 call VerifyScreenDump(buf, 'Test_wildmenu_2', {}) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
180 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
181 call term_sendkeys(buf, "\<Tab>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
182 call VerifyScreenDump(buf, 'Test_wildmenu_3', {}) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
183 |
23938
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23853
diff
changeset
|
184 call term_sendkeys(buf, "\<Tab>\<Tab>") |
22061
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
185 call VerifyScreenDump(buf, 'Test_wildmenu_4', {}) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
186 call term_sendkeys(buf, "\<Esc>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
187 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
188 " clean up |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
189 call StopVimInTerminal(buf) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
190 endfunc |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
191 |
28530
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
192 func Test_redraw_in_autocmd() |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
193 CheckScreendump |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
194 |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
195 let lines =<< trim END |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
196 set cmdheight=2 |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
197 autocmd CmdlineChanged * redraw |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
198 END |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
199 call writefile(lines, 'XTest_redraw', 'D') |
28530
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
200 |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
201 let buf = RunVimInTerminal('-S XTest_redraw', {'rows': 8}) |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
202 call term_sendkeys(buf, ":for i in range(3)\<CR>") |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
203 call VerifyScreenDump(buf, 'Test_redraw_in_autocmd_1', {}) |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
204 |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
205 call term_sendkeys(buf, "let i =") |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
206 call VerifyScreenDump(buf, 'Test_redraw_in_autocmd_2', {}) |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
207 |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
208 " clean up |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
209 call term_sendkeys(buf, "\<CR>") |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
210 call StopVimInTerminal(buf) |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
211 endfunc |
80085afc2f4d
patch 8.2.4789: cursor pos wrong when using :redraw while editing the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28427
diff
changeset
|
212 |
30343
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
213 func Test_redrawstatus_in_autocmd() |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
214 CheckScreendump |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
215 |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
216 let lines =<< trim END |
30353
7cd4655d7bf1
patch 9.0.0512: cannot redraw the status lines when editing a command
Bram Moolenaar <Bram@vim.org>
parents:
30343
diff
changeset
|
217 set laststatus=2 |
7cd4655d7bf1
patch 9.0.0512: cannot redraw the status lines when editing a command
Bram Moolenaar <Bram@vim.org>
parents:
30343
diff
changeset
|
218 set statusline=%=:%{getcmdline()} |
30363
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
219 autocmd CmdlineChanged * redrawstatus |
30343
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
220 END |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
221 call writefile(lines, 'XTest_redrawstatus', 'D') |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
222 |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
223 let buf = RunVimInTerminal('-S XTest_redrawstatus', {'rows': 8}) |
30353
7cd4655d7bf1
patch 9.0.0512: cannot redraw the status lines when editing a command
Bram Moolenaar <Bram@vim.org>
parents:
30343
diff
changeset
|
224 " :redrawstatus is postponed if messages have scrolled |
30343
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
225 call term_sendkeys(buf, ":echo \"one\\ntwo\\nthree\\nfour\"\<CR>") |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
226 call term_sendkeys(buf, ":foobar") |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
227 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_1', {}) |
30353
7cd4655d7bf1
patch 9.0.0512: cannot redraw the status lines when editing a command
Bram Moolenaar <Bram@vim.org>
parents:
30343
diff
changeset
|
228 " it is not postponed if messages have not scrolled |
30363
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
229 call term_sendkeys(buf, "\<Esc>:for in in range(3)") |
30353
7cd4655d7bf1
patch 9.0.0512: cannot redraw the status lines when editing a command
Bram Moolenaar <Bram@vim.org>
parents:
30343
diff
changeset
|
230 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_2', {}) |
30363
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
231 " with cmdheight=1 messages have scrolled when typing :endfor |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
232 call term_sendkeys(buf, "\<CR>:endfor") |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
233 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_3', {}) |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
234 call term_sendkeys(buf, "\<CR>:set cmdheight=2\<CR>") |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
235 " with cmdheight=2 messages haven't scrolled when typing :for or :endfor |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
236 call term_sendkeys(buf, ":for in in range(3)") |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
237 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_4', {}) |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
238 call term_sendkeys(buf, "\<CR>:endfor") |
48c73657679c
patch 9.0.0517: when at the command line :redrawstatus does not work well
Bram Moolenaar <Bram@vim.org>
parents:
30353
diff
changeset
|
239 call VerifyScreenDump(buf, 'Test_redrawstatus_in_autocmd_5', {}) |
30343
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
240 |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
241 " clean up |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
242 call term_sendkeys(buf, "\<CR>") |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
243 call StopVimInTerminal(buf) |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
244 endfunc |
4c9b74365164
patch 9.0.0507: cmdline cleared when using :redrawstatus in CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
30275
diff
changeset
|
245 |
29700
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
246 func Test_changing_cmdheight() |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
247 CheckScreendump |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
248 |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
249 let lines =<< trim END |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
250 set cmdheight=1 laststatus=2 |
30661
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
251 func EchoTwo() |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
252 set laststatus=2 |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
253 set cmdheight=5 |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
254 echo 'foo' |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
255 echo 'bar' |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
256 set cmdheight=1 |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
257 endfunc |
29700
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
258 END |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
259 call writefile(lines, 'XTest_cmdheight', 'D') |
29700
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
260 |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
261 let buf = RunVimInTerminal('-S XTest_cmdheight', {'rows': 8}) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
262 call term_sendkeys(buf, ":resize -3\<CR>") |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
263 call VerifyScreenDump(buf, 'Test_changing_cmdheight_1', {}) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
264 |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
265 " using the space available doesn't change the status line |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
266 call term_sendkeys(buf, ":set cmdheight+=3\<CR>") |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
267 call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {}) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
268 |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
269 " using more space moves the status line up |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
270 call term_sendkeys(buf, ":set cmdheight+=1\<CR>") |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
271 call VerifyScreenDump(buf, 'Test_changing_cmdheight_3', {}) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
272 |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
273 " reducing cmdheight moves status line down |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
274 call term_sendkeys(buf, ":set cmdheight-=2\<CR>") |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
275 call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {}) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
276 |
31906
9fc3b3928ad5
patch 9.0.1285: various small problems
Bram Moolenaar <Bram@vim.org>
parents:
31798
diff
changeset
|
277 " reducing window size and then setting cmdheight |
29702
c43738957bee
patch 9.0.0191: messages test fails; window size incorrect
Bram Moolenaar <Bram@vim.org>
parents:
29700
diff
changeset
|
278 call term_sendkeys(buf, ":resize -1\<CR>") |
c43738957bee
patch 9.0.0191: messages test fails; window size incorrect
Bram Moolenaar <Bram@vim.org>
parents:
29700
diff
changeset
|
279 call term_sendkeys(buf, ":set cmdheight=1\<CR>") |
c43738957bee
patch 9.0.0191: messages test fails; window size incorrect
Bram Moolenaar <Bram@vim.org>
parents:
29700
diff
changeset
|
280 call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {}) |
c43738957bee
patch 9.0.0191: messages test fails; window size incorrect
Bram Moolenaar <Bram@vim.org>
parents:
29700
diff
changeset
|
281 |
30661
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
282 " setting 'cmdheight' works after outputting two messages |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
283 call term_sendkeys(buf, ":call EchoTwo()\<CR>") |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
284 call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {}) |
57ebc2a4d2ca
patch 9.0.0665: setting 'cmdheight' has no effect if last window was resized
Bram Moolenaar <Bram@vim.org>
parents:
30363
diff
changeset
|
285 |
29700
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
286 " clean up |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
287 call StopVimInTerminal(buf) |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
288 endfunc |
cc0f638f5f6b
patch 9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
29617
diff
changeset
|
289 |
30671
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
290 func Test_cmdheight_tabline() |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
291 CheckScreendump |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
292 |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
293 let buf = RunVimInTerminal('-c "set ls=2" -c "set stal=2" -c "set cmdheight=1"', {'rows': 6}) |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
294 call VerifyScreenDump(buf, 'Test_cmdheight_tabline_1', {}) |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
295 |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
296 " clean up |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
297 call StopVimInTerminal(buf) |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
298 endfunc |
15ac28c12c8f
patch 9.0.0670: no space for command line when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents:
30661
diff
changeset
|
299 |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
300 func Test_map_completion() |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
301 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
|
302 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
316 map <Middle>x middle |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
317 |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
318 map ,f commaf |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
319 map ,g commaf |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
320 map <Left> left |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
321 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
|
322 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
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 call assert_equal("\"map <A-Left>\<Tab>", getreg(':')) |
31966
3f39349c5107
patch 9.0.1315: escaping for completion of map command not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
31906
diff
changeset
|
330 call feedkeys(":map <M-Left>\<Tab>\<Home>\"\<CR>", 'xt') |
3f39349c5107
patch 9.0.1315: escaping for completion of map command not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
31906
diff
changeset
|
331 call assert_equal("\"map <M-Left>x", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
332 unmap ,f |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
333 unmap ,g |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
334 unmap <Left> |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
335 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
|
336 |
31966
3f39349c5107
patch 9.0.1315: escaping for completion of map command not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
31906
diff
changeset
|
337 set cpo-=< cpo-=k |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
338 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
339 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
|
340 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
|
341 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
|
342 call assert_equal("\"map <M\<Tab>", getreg(':')) |
31966
3f39349c5107
patch 9.0.1315: escaping for completion of map command not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
31906
diff
changeset
|
343 call feedkeys(":map \<C-V>\<C-V><M\<Tab>\<Home>\"\<CR>", 'xt') |
3f39349c5107
patch 9.0.1315: escaping for completion of map command not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
31906
diff
changeset
|
344 call assert_equal("\"map \<C-V><Middle>x", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
345 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
346 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
347 set cpo+=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
348 map <Left> left |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
349 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
|
350 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
|
351 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
|
352 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
|
353 if !has('gui_running') |
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
354 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
|
355 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
|
356 endif |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
357 unmap <Left> |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
358 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
|
359 set cpo-=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
360 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
361 set cpo+=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
362 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
363 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
|
364 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
|
365 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
366 set cpo-=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
367 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
368 set cpo+=k |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
369 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
370 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
|
371 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
|
372 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
373 set cpo-=k |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
374 |
22375
595ea7f099cd
patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents:
22169
diff
changeset
|
375 call assert_fails('call feedkeys(":map \\\\%(\<Tab>\<Home>\"\<CR>", "xt")', 'E53:') |
595ea7f099cd
patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents:
22169
diff
changeset
|
376 |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
377 unmap <Middle>x |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
378 set cpo&vim |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
379 endfunc |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
380 |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
381 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
|
382 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
|
383 call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
384 call assert_equal('"match Aardig', @:) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
385 call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
386 call assert_equal('"match none', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
387 call feedkeys(":match | chist\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
388 call assert_equal('"match | chistory', @:) |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
389 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
390 |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
391 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
|
392 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
|
393 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
|
394 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
|
395 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
|
396 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
|
397 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
|
398 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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 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
|
404 call assert_equal('"hi clear', getreg(':')) |
21052
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
405 call feedkeys(":hi clear Aardig Aard\<Tab>\<C-B>\"\<CR>", 'xt') |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
406 call assert_equal('"hi clear Aardig Aardig', getreg(':')) |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
407 call feedkeys(":hi Aardig \<Tab>\<C-B>\"\<CR>", 'xt') |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
408 call assert_equal("\"hi Aardig \t", getreg(':')) |
11254
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
409 |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
410 " 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
418 |
21052
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
419 " Test for command-line expansion of "hi Ni " (easter egg) |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
420 func Test_highlight_easter_egg() |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
421 call test_override('ui_delay', 1) |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
422 call feedkeys(":hi Ni \<Tab>\<C-B>\"\<CR>", 'xt') |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
423 call assert_equal("\"hi Ni \<Tab>", @:) |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
424 call test_override('ALL', 0) |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
425 endfunc |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
426 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
427 func Test_getcompletion() |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
428 let groupcount = len(getcompletion('', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
429 call assert_true(groupcount > 0) |
17857
4935244c1128
patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17093
diff
changeset
|
430 let matchcount = len('File'->getcompletion('event')) |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
431 call assert_true(matchcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
432 call assert_true(groupcount > matchcount) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
433 |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
434 if has('menu') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
435 source $VIMRUNTIME/menu.vim |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
436 let matchcount = len(getcompletion('', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
437 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
438 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
|
439 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
440 let matchcount = len(getcompletion('File.', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
441 call assert_true(matchcount > 0) |
31792
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
442 source $VIMRUNTIME/delmenu.vim |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
443 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
444 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
445 let l = getcompletion('v:n', 'var') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
446 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
|
447 let l = getcompletion('v:notexists', 'var') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
448 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
449 |
13551
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
450 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
|
451 let l = getcompletion('', 'arglist') |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
452 call assert_equal(['a.c', 'b.c'], l) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
453 let l = getcompletion('a.', 'buffer') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
454 call assert_equal(['a.c'], l) |
13551
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
455 %argdelete |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
456 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
457 let l = getcompletion('', 'augroup') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
458 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
|
459 let l = getcompletion('blahblah', 'augroup') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
460 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
461 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
462 let l = getcompletion('', 'behave') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
463 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
|
464 let l = getcompletion('not', 'behave') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
465 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
466 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
467 let l = getcompletion('', 'color') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
468 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
|
469 let l = getcompletion('dirty', 'color') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
470 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
471 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
472 let l = getcompletion('', 'command') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
473 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
|
474 let l = getcompletion('awake', 'command') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
475 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
476 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
477 let l = getcompletion('', 'dir') |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
478 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
|
479 let l = getcompletion('NoMatch', 'dir') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
480 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
481 |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
482 if glob('~/*') !=# '' |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
483 let l = getcompletion('~/', 'dir') |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
484 call assert_true(l[0][0] ==# '~') |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
485 endif |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
486 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
487 let l = getcompletion('exe', 'expression') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
488 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
|
489 let l = getcompletion('kill', 'expression') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
490 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
491 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
492 let l = getcompletion('tag', 'function') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
493 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
|
494 let l = getcompletion('paint', 'function') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
495 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
496 |
31772
152bb9e6b4b4
patch 9.0.1218: completion includes functions that don't work
Bram Moolenaar <Bram@vim.org>
parents:
31632
diff
changeset
|
497 if !has('ruby') |
31906
9fc3b3928ad5
patch 9.0.1285: various small problems
Bram Moolenaar <Bram@vim.org>
parents:
31798
diff
changeset
|
498 " global_functions[] has an entry but it doesn't have an implementation |
31772
152bb9e6b4b4
patch 9.0.1218: completion includes functions that don't work
Bram Moolenaar <Bram@vim.org>
parents:
31632
diff
changeset
|
499 let l = getcompletion('ruby', 'function') |
152bb9e6b4b4
patch 9.0.1218: completion includes functions that don't work
Bram Moolenaar <Bram@vim.org>
parents:
31632
diff
changeset
|
500 call assert_equal([], l) |
152bb9e6b4b4
patch 9.0.1218: completion includes functions that don't work
Bram Moolenaar <Bram@vim.org>
parents:
31632
diff
changeset
|
501 endif |
152bb9e6b4b4
patch 9.0.1218: completion includes functions that don't work
Bram Moolenaar <Bram@vim.org>
parents:
31632
diff
changeset
|
502 |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
503 let Flambda = {-> 'hello'} |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
504 let l = getcompletion('', 'function') |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
505 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
|
506 call assert_equal([], l) |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
507 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
508 let l = getcompletion('run', 'file') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
509 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
|
510 let l = getcompletion('walk', 'file') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
511 call assert_equal([], l) |
9861
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
512 set wildignore=*.vim |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
513 let l = getcompletion('run', 'file', 1) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
514 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
|
515 set wildignore& |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
516 " Directory name with space character |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
517 call mkdir('Xdir with space', 'D') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
518 call assert_equal(['Xdir with space/'], getcompletion('Xdir\ w', 'shellcmd')) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
519 call assert_equal(['./Xdir with space/'], getcompletion('./Xdir', 'shellcmd')) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
520 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
521 let l = getcompletion('ha', 'filetype') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
522 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
|
523 let l = getcompletion('horse', 'filetype') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
524 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
525 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
526 let l = getcompletion('z', 'syntax') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
527 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
|
528 let l = getcompletion('emacs', 'syntax') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
529 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
530 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
531 let l = getcompletion('jikes', 'compiler') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
532 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
|
533 let l = getcompletion('break', 'compiler') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
534 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
535 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
536 let l = getcompletion('last', 'help') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
537 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
|
538 let l = getcompletion('giveup', 'help') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
539 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
540 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
541 let l = getcompletion('time', 'option') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
542 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
|
543 let l = getcompletion('space', 'option') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
544 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
545 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
546 let l = getcompletion('er', 'highlight') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
547 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
|
548 let l = getcompletion('dark', 'highlight') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
549 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
550 |
10275
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
551 let l = getcompletion('', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
552 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
|
553 let l = getcompletion('not', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
554 call assert_equal([], l) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
555 |
11995
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
556 let l = getcompletion('', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
557 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
|
558 let l = getcompletion('not', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
559 call assert_equal([], l) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
560 |
13998
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
561 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
|
562 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
|
563 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
|
564 let root = has('win32') ? 'C:\\' : '/' |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
565 let l = getcompletion(root, 'shellcmd') |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
566 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
|
567 \ '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
|
568 call assert_equal(expected, l) |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
569 |
9766
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
570 if has('cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
571 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
572 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
|
573 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
574 " 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
|
575 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
|
576 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
577 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
578 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
|
579 let l = getcompletion('find ', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
580 call assert_equal(keys, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
581 endif |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
582 |
9774
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
583 if has('signs') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
584 sign define Testing linehl=Comment |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
585 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
586 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
|
587 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
588 " 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
|
589 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
|
590 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
591 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
592 let l = getcompletion('list ', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
593 call assert_equal(['Testing'], l) |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
594 let l = getcompletion('de*', 'sign') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
595 call assert_equal(['define'], l) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
596 let l = getcompletion('p?', 'sign') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
597 call assert_equal(['place'], l) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
598 let l = getcompletion('j.', 'sign') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
599 call assert_equal(['jump'], l) |
9774
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
600 endif |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
601 |
20745
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
602 " Command line completion tests |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
603 let l = getcompletion('cd ', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
604 call assert_true(index(l, 'samples/') >= 0) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
605 let l = getcompletion('cd NoMatch', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
606 call assert_equal([], l) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
607 let l = getcompletion('let v:n', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
608 call assert_true(index(l, 'v:null') >= 0) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
609 let l = getcompletion('let v:notexists', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
610 call assert_equal([], l) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
611 let l = getcompletion('call tag', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
612 call assert_true(index(l, 'taglist(') >= 0) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
613 let l = getcompletion('call paint', 'cmdline') |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
614 call assert_equal([], l) |
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
615 |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
616 func T(a, c, p) |
26213
ee1c116b91ea
patch 8.2.3638: getcompletion() always passes zero as position
Bram Moolenaar <Bram@vim.org>
parents:
26153
diff
changeset
|
617 let g:cmdline_compl_params = [a:a, a:c, a:p] |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
618 return "oneA\noneB\noneC" |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
619 endfunc |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
620 command -nargs=1 -complete=custom,T MyCmd |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
621 let l = getcompletion('MyCmd ', 'cmdline') |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
622 call assert_equal(['oneA', 'oneB', 'oneC'], l) |
26213
ee1c116b91ea
patch 8.2.3638: getcompletion() always passes zero as position
Bram Moolenaar <Bram@vim.org>
parents:
26153
diff
changeset
|
623 call assert_equal(['', 'MyCmd ', 6], g:cmdline_compl_params) |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
624 |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
625 delcommand MyCmd |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
626 delfunc T |
26213
ee1c116b91ea
patch 8.2.3638: getcompletion() always passes zero as position
Bram Moolenaar <Bram@vim.org>
parents:
26153
diff
changeset
|
627 unlet g:cmdline_compl_params |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
628 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
629 " 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
|
630 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
|
631 if has('cmdline_hist') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
632 call add(names, 'history') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
633 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
634 if has('gettext') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
635 call add(names, 'locale') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
636 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
637 if has('profile') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
638 call add(names, 'syntime') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
639 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
640 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
641 set tags=Xtags |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
642 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags', 'D') |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
643 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
644 for name in names |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
645 let matchcount = len(getcompletion('', name)) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
646 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
|
647 endfor |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
648 |
17093
5cda6165a5c1
patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents:
16529
diff
changeset
|
649 set tags& |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
650 |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
651 edit a~b |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
652 enew |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
653 call assert_equal(['a~b'], getcompletion('a~', 'buffer')) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
654 bw a~b |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
655 |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
656 if has('unix') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
657 edit Xtest\ |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
658 enew |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
659 call assert_equal(['Xtest\'], getcompletion('Xtest\', 'buffer')) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
660 bw Xtest\ |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
661 endif |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
662 |
20990
55b3849ded11
patch 8.2.1046: insufficient tests for src/buffer.c
Bram Moolenaar <Bram@vim.org>
parents:
20911
diff
changeset
|
663 call assert_fails("call getcompletion('\\\\@!\\\\@=', 'buffer')", 'E871:') |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
664 call assert_fails('call getcompletion("", "burp")', 'E475:') |
30043
fd855ad74887
patch 9.0.0359: error message for wrong argument type is not specific
Bram Moolenaar <Bram@vim.org>
parents:
30017
diff
changeset
|
665 call assert_fails('call getcompletion("abc", [])', 'E1174:') |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
666 endfunc |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
667 |
31624
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
668 func Test_multibyte_expression() |
31632
874f82a0817c
patch 9.0.1148: cmdline test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31624
diff
changeset
|
669 " Get a dialog in the GUI |
874f82a0817c
patch 9.0.1148: cmdline test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31624
diff
changeset
|
670 CheckNotGui |
874f82a0817c
patch 9.0.1148: cmdline test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31624
diff
changeset
|
671 |
31624
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
672 " This was using uninitialized memory. |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
673 let lines =<< trim END |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
674 set verbose=6 |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
675 norm @=ٷ |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
676 qall! |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
677 END |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
678 call writefile(lines, 'XmultiScript', 'D') |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
679 call RunVim('', '', '-u NONE -n -e -s -S XmultiScript') |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
680 endfunc |
d605a50e7623
patch 9.0.1144: reading beyond text
Bram Moolenaar <Bram@vim.org>
parents:
31398
diff
changeset
|
681 |
28166
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
682 " Test for getcompletion() with "fuzzy" in 'wildoptions' |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
683 func Test_getcompletion_wildoptions() |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
684 let save_wildoptions = &wildoptions |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
685 set wildoptions& |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
686 let l = getcompletion('space', 'option') |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
687 call assert_equal([], l) |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
688 let l = getcompletion('ier', 'command') |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
689 call assert_equal([], l) |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
690 set wildoptions=fuzzy |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
691 let l = getcompletion('space', 'option') |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
692 call assert_true(index(l, 'backspace') >= 0) |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
693 let l = getcompletion('ier', 'command') |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
694 call assert_true(index(l, 'compiler') >= 0) |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
695 let &wildoptions = save_wildoptions |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
696 endfunc |
130f4082a13d
patch 8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"
Bram Moolenaar <Bram@vim.org>
parents:
28121
diff
changeset
|
697 |
28107
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
698 func Test_complete_autoload_error() |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
699 let save_rtp = &rtp |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
700 let lines =<< trim END |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
701 vim9script |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
702 export def Complete(..._): string |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
703 return 'match' |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
704 enddef |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
705 echo this will cause an error |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
706 END |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
707 call mkdir('Xdir/autoload', 'pR') |
28107
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
708 call writefile(lines, 'Xdir/autoload/script.vim') |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
709 exe 'set rtp+=' .. getcwd() .. '/Xdir' |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
710 |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
711 let lines =<< trim END |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
712 vim9script |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
713 import autoload 'script.vim' |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
714 command -nargs=* -complete=custom,script.Complete Cmd eval 0 + 0 |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
715 &wildcharm = char2nr("\<Tab>") |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
716 feedkeys(":Cmd \<Tab>", 'xt') |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
717 END |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
718 call v9.CheckScriptFailure(lines, 'E121: Undefined variable: this') |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
719 |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
720 let &rtp = save_rtp |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
721 endfunc |
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
722 |
23853
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
723 func Test_fullcommand() |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
724 let tests = { |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
725 \ '': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
726 \ ':': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
727 \ ':::': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
728 \ ':::5': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
729 \ 'not_a_cmd': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
730 \ 'Check': '', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
731 \ 'syntax': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
732 \ ':syntax': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
733 \ '::::syntax': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
734 \ 'sy': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
735 \ 'syn': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
736 \ 'synt': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
737 \ ':sy': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
738 \ '::::sy': 'syntax', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
739 \ 'match': 'match', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
740 \ '2match': 'match', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
741 \ '3match': 'match', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
742 \ 'aboveleft': 'aboveleft', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
743 \ 'abo': 'aboveleft', |
30275
121d28008c14
patch 9.0.0473: fullcommand() only works for the current script version
Bram Moolenaar <Bram@vim.org>
parents:
30255
diff
changeset
|
744 \ 'en': 'endif', |
121d28008c14
patch 9.0.0473: fullcommand() only works for the current script version
Bram Moolenaar <Bram@vim.org>
parents:
30255
diff
changeset
|
745 \ 'end': 'endif', |
121d28008c14
patch 9.0.0473: fullcommand() only works for the current script version
Bram Moolenaar <Bram@vim.org>
parents:
30255
diff
changeset
|
746 \ 'endi': 'endif', |
23853
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
747 \ 's': 'substitute', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
748 \ '5s': 'substitute', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
749 \ ':5s': 'substitute', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
750 \ "'<,'>s": 'substitute', |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
751 \ ":'<,'>s": 'substitute', |
28317
d32dc906dd2c
patch 8.2.4684: cannot open a channel on a Unix domain socket
Bram Moolenaar <Bram@vim.org>
parents:
28259
diff
changeset
|
752 \ 'CheckLin': 'CheckLinux', |
d32dc906dd2c
patch 8.2.4684: cannot open a channel on a Unix domain socket
Bram Moolenaar <Bram@vim.org>
parents:
28259
diff
changeset
|
753 \ 'CheckLinux': 'CheckLinux', |
23853
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
754 \ } |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
755 |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
756 for [in, want] in items(tests) |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
757 call assert_equal(want, fullcommand(in)) |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
758 endfor |
24697
a6e43da449af
patch 8.2.2887: crash when passing null string to fullcommand()
Bram Moolenaar <Bram@vim.org>
parents:
24669
diff
changeset
|
759 call assert_equal('', fullcommand(test_null_string())) |
23853
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
760 |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
761 call assert_equal('syntax', 'syn'->fullcommand()) |
25757
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
762 |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
763 command -buffer BufferLocalCommand : |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
764 command GlobalCommand : |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
765 call assert_equal('GlobalCommand', fullcommand('GlobalCom')) |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
766 call assert_equal('BufferLocalCommand', fullcommand('BufferL')) |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
767 delcommand BufferLocalCommand |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
768 delcommand GlobalCommand |
23853
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
769 endfunc |
a9ed31ab85c3
patch 8.2.2468: not easy to get the full command name from a shortened one
Bram Moolenaar <Bram@vim.org>
parents:
23784
diff
changeset
|
770 |
14417
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
771 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
|
772 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
|
773 |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
774 call mkdir('Xpathdir/Xpathsubdir', 'pR') |
14417
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
775 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
|
776 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
|
777 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
778 " 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
|
779 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
|
780 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
781 " 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
|
782 " 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
|
783 " 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
|
784 " suggestions. |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
785 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
|
786 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
|
787 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
|
788 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
|
789 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
790 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
|
791 endfunc |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
792 |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
793 func Test_expand_star_star() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
794 call mkdir('a/b', 'pR') |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
795 call writefile(['asdfasdf'], 'a/b/fileXname') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
796 call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
797 call assert_equal('find a/b/fileXname', @:) |
10007
a4d4ee212dab
commit https://github.com/vim/vim/commit/1773ddfdcd106fa3bbf479c9b62ccde03c2a86ba
Christian Brabandt <cb@256bit.org>
parents:
10002
diff
changeset
|
798 bwipe! |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
799 endfunc |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
800 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
801 func Test_cmdline_paste() |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
802 let @a = "def" |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
803 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
|
804 call assert_equal('"abc def ghi', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
805 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
806 new |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
807 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
|
808 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
809 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
|
810 call assert_equal('"aaa asdf bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
811 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
812 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
|
813 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
|
814 |
13831
1f95ec5de238
patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents:
13600
diff
changeset
|
815 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
|
816 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
|
817 |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
818 set incsearch |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
819 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
|
820 call assert_equal('"aaa verylongword bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
821 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
822 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
|
823 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
|
824 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
825 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
|
826 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
|
827 bwipe! |
13600
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
828 |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
829 " 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
|
830 " 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
|
831 new |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
832 try |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
833 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
|
834 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
|
835 " 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
|
836 endtry |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
837 call assert_equal("Xtestfile", bufname("%")) |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
838 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
839 " Try to paste an invalid register using <C-R> |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
840 call feedkeys(":\"one\<C-R>\<C-X>two\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
841 call assert_equal('"onetwo', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
842 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
843 " Test for pasting register containing CTRL-H using CTRL-R and CTRL-R CTRL-R |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
844 let @a = "xy\<C-H>z" |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
845 call feedkeys(":\"\<C-R>a\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
846 call assert_equal('"xz', @:) |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
847 call feedkeys(":\"\<C-R>\<C-R>a\<CR>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
848 call assert_equal("\"xy\<C-H>z", @:) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
849 call feedkeys(":\"\<C-R>\<C-O>a\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
850 call assert_equal("\"xy\<C-H>z", @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
851 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
852 " Test for pasting register containing CTRL-V using CTRL-R and CTRL-R CTRL-R |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
853 let @a = "xy\<C-V>z" |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
854 call feedkeys(":\"\<C-R>=@a\<CR>\<cr>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
855 call assert_equal('"xyz', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
856 call feedkeys(":\"\<C-R>\<C-R>=@a\<CR>\<cr>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
857 call assert_equal("\"xy\<C-V>z", @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
858 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
859 call assert_beeps('call feedkeys(":\<C-R>=\<C-R>=\<Esc>", "xt")') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
860 |
13600
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
861 bwipe! |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
862 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
863 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
864 func Test_cmdline_remove_char() |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
865 let encoding_save = &encoding |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
866 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
867 for e in ['utf8', 'latin1'] |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
868 exe 'set encoding=' . e |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
869 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
870 call feedkeys(":abc def\<S-Left>\<Del>\<C-B>\"\<CR>", 'tx') |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
871 call assert_equal('"abc ef', @:, e) |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
872 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
873 call feedkeys(":abc def\<S-Left>\<BS>\<C-B>\"\<CR>", 'tx') |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
874 call assert_equal('"abcdef', @:) |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
875 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
876 call feedkeys(":abc def ghi\<S-Left>\<C-W>\<C-B>\"\<CR>", 'tx') |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
877 call assert_equal('"abc ghi', @:, e) |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
878 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
879 call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx') |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
880 call assert_equal('"def', @:, e) |
28749
4a9fdf708575
patch 8.2.4899: with latin1 encoding CTRL-W might go before the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28741
diff
changeset
|
881 |
4a9fdf708575
patch 8.2.4899: with latin1 encoding CTRL-W might go before the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28741
diff
changeset
|
882 " This was going before the start in latin1. |
4a9fdf708575
patch 8.2.4899: with latin1 encoding CTRL-W might go before the cmdline
Bram Moolenaar <Bram@vim.org>
parents:
28741
diff
changeset
|
883 call feedkeys(": \<C-W>\<CR>", 'tx') |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
884 endfor |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
885 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
886 let &encoding = encoding_save |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
887 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
888 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
889 func Test_cmdline_keymap_ctrl_hat() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
890 CheckFeature keymap |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
891 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
892 set keymap=esperanto |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
893 call feedkeys(":\"Jxauxdo \<C-^>Jxauxdo \<C-^>Jxauxdo\<CR>", 'tx') |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
894 call assert_equal('"Jxauxdo Ĵaŭdo Jxauxdo', @:) |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
895 set keymap= |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
896 endfunc |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
897 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
898 func Test_illegal_address1() |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
899 new |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
900 2;'( |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
901 2;') |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
902 quit |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
903 endfunc |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
904 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
905 func Test_illegal_address2() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
906 call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim', 'D') |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
907 new |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
908 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
|
909 " 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
|
910 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
|
911 quit! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
912 bwipe! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
913 endfunc |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
914 |
29263
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
915 func Test_mark_from_line_zero() |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
916 " this was reading past the end of the first (empty) line |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
917 new |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
918 norm oxxxx |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
919 call assert_fails("0;'(", 'E20:') |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
920 bwipe! |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
921 endfunc |
8408ffd9af69
patch 8.2.5150: read past the end of the first line with ":0;'{"
Bram Moolenaar <Bram@vim.org>
parents:
29259
diff
changeset
|
922 |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
923 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
|
924 help |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
925 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
|
926 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
|
927 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
|
928 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
|
929 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
|
930 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
|
931 bw! |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
932 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
|
933 |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
934 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
|
935 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
|
936 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
|
937 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
|
938 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
|
939 call assert_equal('"Foo blue', @:) |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
940 call feedkeys(":Foo a b\<Tab>\<Home>\"\<cr>", 'tx') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
941 call assert_equal('"Foo a blue', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
942 call feedkeys(":Foo b\\\<Tab>\<Home>\"\<cr>", 'tx') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
943 call assert_equal('"Foo b\', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
944 call feedkeys(":Foo b\\x\<Tab>\<Home>\"\<cr>", 'tx') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
945 call assert_equal('"Foo b\x', @:) |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
946 delcommand Foo |
29798
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
947 |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
948 redraw |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
949 call assert_equal('~', Screenline(&lines - 1)) |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
950 command! FooOne : |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
951 command! FooTwo : |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
952 |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
953 set nowildmenu |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
954 call feedkeys(":Foo\<Tab>\<Home>\"\<cr>", 'tx') |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
955 call assert_equal('"FooOne', @:) |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
956 call assert_equal('~', Screenline(&lines - 1)) |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
957 |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
958 call feedkeys(":Foo\<S-Tab>\<Home>\"\<cr>", 'tx') |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
959 call assert_equal('"FooTwo', @:) |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
960 call assert_equal('~', Screenline(&lines - 1)) |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
961 |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
962 delcommand FooOne |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
963 delcommand FooTwo |
e038b8dd7cd9
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off
Bram Moolenaar <Bram@vim.org>
parents:
29794
diff
changeset
|
964 set wildmenu& |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
965 endfunc |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
966 |
29479
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
967 func Test_complete_user_cmd() |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
968 command FooBar echo 'global' |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
969 command -buffer FooBar echo 'local' |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
970 call feedkeys(":Foo\<C-A>\<Home>\"\<CR>", 'tx') |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
971 call assert_equal('"FooBar', @:) |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
972 |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
973 delcommand -buffer FooBar |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
974 delcommand FooBar |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
975 endfunc |
5c390aa28f44
patch 9.0.0081: command line completion of user command may have duplicates
Bram Moolenaar <Bram@vim.org>
parents:
29369
diff
changeset
|
976 |
19556
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
977 func s:ScriptLocalFunction() |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
978 echo 'yes' |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
979 endfunc |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
980 |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
981 func Test_cmdline_complete_user_func() |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
982 call feedkeys(":func Test_cmdline_complete_user\<Tab>\<Home>\"\<cr>", 'tx') |
25648
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
983 call assert_match('"func Test_cmdline_complete_user_', @:) |
19556
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
984 call feedkeys(":func s:ScriptL\<Tab>\<Home>\"\<cr>", 'tx') |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
985 call assert_match('"func <SNR>\d\+_ScriptLocalFunction', @:) |
23598
a9433f834693
patch 8.2.2341: expresison command line completion incomplete after "g:"
Bram Moolenaar <Bram@vim.org>
parents:
23382
diff
changeset
|
986 |
a9433f834693
patch 8.2.2341: expresison command line completion incomplete after "g:"
Bram Moolenaar <Bram@vim.org>
parents:
23382
diff
changeset
|
987 " g: prefix also works |
a9433f834693
patch 8.2.2341: expresison command line completion incomplete after "g:"
Bram Moolenaar <Bram@vim.org>
parents:
23382
diff
changeset
|
988 call feedkeys(":echo g:Test_cmdline_complete_user_f\<Tab>\<Home>\"\<cr>", 'tx') |
a9433f834693
patch 8.2.2341: expresison command line completion incomplete after "g:"
Bram Moolenaar <Bram@vim.org>
parents:
23382
diff
changeset
|
989 call assert_match('"echo g:Test_cmdline_complete_user_func', @:) |
25601
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
990 |
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
991 " using g: prefix does not result in just "g:" matches from a lambda |
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
992 let Fx = { a -> a } |
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
993 call feedkeys(":echo g:\<Tab>\<Home>\"\<cr>", 'tx') |
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
994 call assert_match('"echo g:[A-Z]', @:) |
25648
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
995 |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
996 " existence of script-local dict function does not break user function name |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
997 " completion |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
998 function s:a_dict_func() dict |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
999 endfunction |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
1000 call feedkeys(":call Test_cmdline_complete_user\<Tab>\<Home>\"\<cr>", 'tx') |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
1001 call assert_match('"call Test_cmdline_complete_user_', @:) |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
1002 delfunction s:a_dict_func |
19556
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
1003 endfunc |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
1004 |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1005 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
|
1006 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
|
1007 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
|
1008 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
|
1009 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
|
1010 " 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
|
1011 " 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
|
1012 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
|
1013 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
|
1014 endif |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1015 elseif has('win32') |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1016 " 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
|
1017 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
|
1018 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
|
1019 " 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
|
1020 " 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
|
1021 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
|
1022 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
|
1023 endif |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1024 else |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1025 throw 'Skipped: does not work on this platform' |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1026 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1027 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1028 |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1029 func Test_cmdline_complete_bang() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1030 CheckExecutable whoami |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1031 call feedkeys(":!whoam\<C-A>\<C-B>\"\<CR>", 'tx') |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1032 call assert_match('^".*\<whoami\>', @:) |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1033 endfunc |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1034 |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19689
diff
changeset
|
1035 func Test_cmdline_complete_languages() |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1036 let lang = substitute(execute('language time'), '.*"\(.*\)"$', '\1', '') |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1037 call assert_equal(lang, v:lc_time) |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1038 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1039 let lang = substitute(execute('language ctype'), '.*"\(.*\)"$', '\1', '') |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1040 call assert_equal(lang, v:ctype) |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1041 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1042 let lang = substitute(execute('language collate'), '.*"\(.*\)"$', '\1', '') |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1043 call assert_equal(lang, v:collate) |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1044 |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1045 let lang = substitute(execute('language messages'), '.*"\(.*\)"$', '\1', '') |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1046 call assert_equal(lang, v:lang) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1047 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1048 call feedkeys(":language \<c-a>\<c-b>\"\<cr>", 'tx') |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1049 call assert_match('^"language .*\<collate\>.*\<ctype\>.*\<messages\>.*\<time\>', @:) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1050 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1051 call assert_match('^"language .*\<' . lang . '\>', @:) |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1052 |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1053 call feedkeys(":language messages \<c-a>\<c-b>\"\<cr>", 'tx') |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1054 call assert_match('^"language .*\<' . lang . '\>', @:) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1055 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1056 call feedkeys(":language ctype \<c-a>\<c-b>\"\<cr>", 'tx') |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1057 call assert_match('^"language .*\<' . lang . '\>', @:) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1058 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1059 call feedkeys(":language time \<c-a>\<c-b>\"\<cr>", 'tx') |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
1060 call assert_match('^"language .*\<' . lang . '\>', @:) |
20873
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1061 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1062 call feedkeys(":language collate \<c-a>\<c-b>\"\<cr>", 'tx') |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
1063 call assert_match('^"language .*\<' . lang . '\>', @:) |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1064 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
1065 |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1066 func Test_cmdline_complete_env_variable() |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1067 let $X_VIM_TEST_COMPLETE_ENV = 'foo' |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1068 call feedkeys(":edit $X_VIM_TEST_COMPLETE_E\<C-A>\<C-B>\"\<CR>", 'tx') |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1069 call assert_match('"edit $X_VIM_TEST_COMPLETE_ENV', @:) |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1070 unlet $X_VIM_TEST_COMPLETE_ENV |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1071 endfunc |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
1072 |
23322
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1073 func Test_cmdline_complete_expression() |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1074 let g:SomeVar = 'blah' |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1075 for cmd in ['exe', 'echo', 'echon', 'echomsg'] |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1076 call feedkeys(":" .. cmd .. " SomeV\<Tab>\<C-B>\"\<CR>", 'tx') |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1077 call assert_match('"' .. cmd .. ' SomeVar', @:) |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1078 call feedkeys(":" .. cmd .. " foo SomeV\<Tab>\<C-B>\"\<CR>", 'tx') |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1079 call assert_match('"' .. cmd .. ' foo SomeVar', @:) |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1080 endfor |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1081 unlet g:SomeVar |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1082 endfunc |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
1083 |
25682
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1084 " Unique function name for completion below |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1085 func s:WeirdFunc() |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1086 echo 'weird' |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1087 endfunc |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1088 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1089 " Test for various command-line completion |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1090 func Test_cmdline_complete_various() |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1091 " completion for a command starting with a comment |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1092 call feedkeys(": :|\"\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1093 call assert_equal("\" :|\"\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1094 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1095 " completion for a range followed by a comment |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1096 call feedkeys(":1,2\"\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1097 call assert_equal("\"1,2\"\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1098 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1099 " completion for :k command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1100 call feedkeys(":ka\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1101 call assert_equal("\"ka\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1102 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1103 " completion for short version of the :s command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1104 call feedkeys(":sI \<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1105 call assert_equal("\"sI \<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1106 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1107 " completion for :write command |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1108 call mkdir('Xcwdir', 'R') |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1109 call writefile(['one'], 'Xcwdir/Xfile1') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1110 let save_cwd = getcwd() |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1111 cd Xcwdir |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1112 call feedkeys(":w >> \<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1113 call assert_equal("\"w >> Xfile1", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1114 call chdir(save_cwd) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1115 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1116 " completion for :w ! and :r ! commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1117 call feedkeys(":w !invalid_xyz_cmd\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1118 call assert_equal("\"w !invalid_xyz_cmd", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1119 call feedkeys(":r !invalid_xyz_cmd\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1120 call assert_equal("\"r !invalid_xyz_cmd", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1121 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1122 " completion for :>> and :<< commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1123 call feedkeys(":>>>\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1124 call assert_equal("\">>>\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1125 call feedkeys(":<<<\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1126 call assert_equal("\"<<<\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1127 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1128 " completion for command with +cmd argument |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1129 call feedkeys(":buffer +/pat Xabc\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1130 call assert_equal("\"buffer +/pat Xabc", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1131 call feedkeys(":buffer +/pat\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1132 call assert_equal("\"buffer +/pat\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1133 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1134 " completion for a command with a trailing comment |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1135 call feedkeys(":ls \" comment\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1136 call assert_equal("\"ls \" comment\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1137 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1138 " completion for a command with a trailing command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1139 call feedkeys(":ls | ls\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1140 call assert_equal("\"ls | ls", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1141 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1142 " completion for a command with an CTRL-V escaped argument |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1143 call feedkeys(":ls \<C-V>\<C-V>a\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1144 call assert_equal("\"ls \<C-V>a\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1145 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1146 " completion for a command that doesn't take additional arguments |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1147 call feedkeys(":all abc\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1148 call assert_equal("\"all abc\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1149 |
30017
578e71f924fe
patch 9.0.0346: :horizontal modifier not fully supported
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1150 " completion for :wincmd with :horizontal modifier |
578e71f924fe
patch 9.0.0346: :horizontal modifier not fully supported
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1151 call feedkeys(":horizontal wincm\<C-A>\<C-B>\"\<CR>", 'xt') |
578e71f924fe
patch 9.0.0346: :horizontal modifier not fully supported
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1152 call assert_equal("\"horizontal wincmd", @:) |
578e71f924fe
patch 9.0.0346: :horizontal modifier not fully supported
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1153 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1154 " completion for a command with a command modifier |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1155 call feedkeys(":topleft new\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1156 call assert_equal("\"topleft new", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1157 |
24907
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1158 " completion for vim9 and legacy commands |
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1159 call feedkeys(":vim9 call strle\<C-A>\<C-B>\"\<CR>", 'xt') |
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1160 call assert_equal("\"vim9 call strlen(", @:) |
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1161 call feedkeys(":legac call strle\<C-A>\<C-B>\"\<CR>", 'xt') |
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1162 call assert_equal("\"legac call strlen(", @:) |
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
1163 |
24909
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1164 " completion for the :disassemble command |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1165 call feedkeys(":disas deb\<C-A>\<C-B>\"\<CR>", 'xt') |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1166 call assert_equal("\"disas debug", @:) |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1167 call feedkeys(":disas pro\<C-A>\<C-B>\"\<CR>", 'xt') |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1168 call assert_equal("\"disas profile", @:) |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1169 call feedkeys(":disas debug Test_cmdline_complete_var\<C-A>\<C-B>\"\<CR>", 'xt') |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1170 call assert_equal("\"disas debug Test_cmdline_complete_various", @:) |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1171 call feedkeys(":disas profile Test_cmdline_complete_var\<C-A>\<C-B>\"\<CR>", 'xt') |
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1172 call assert_equal("\"disas profile Test_cmdline_complete_various", @:) |
25694
ce91372ca07b
patch 8.2.3383: Vim9: completion for :disassemble adds parenthesis
Bram Moolenaar <Bram@vim.org>
parents:
25684
diff
changeset
|
1173 call feedkeys(":disas Test_cmdline_complete_var\<C-A>\<C-B>\"\<CR>", 'xt') |
ce91372ca07b
patch 8.2.3383: Vim9: completion for :disassemble adds parenthesis
Bram Moolenaar <Bram@vim.org>
parents:
25684
diff
changeset
|
1174 call assert_equal("\"disas Test_cmdline_complete_various", @:) |
24909
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
1175 |
25682
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1176 call feedkeys(":disas s:WeirdF\<C-A>\<C-B>\"\<CR>", 'xt') |
25694
ce91372ca07b
patch 8.2.3383: Vim9: completion for :disassemble adds parenthesis
Bram Moolenaar <Bram@vim.org>
parents:
25684
diff
changeset
|
1177 call assert_match('"disas <SNR>\d\+_WeirdFunc', @:) |
25682
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
1178 |
25792
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
1179 call feedkeys(":disas \<S-Tab>\<C-B>\"\<CR>", 'xt') |
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
1180 call assert_match('"disas <SNR>\d\+_', @:) |
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
1181 call feedkeys(":disas debug \<S-Tab>\<C-B>\"\<CR>", 'xt') |
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
1182 call assert_match('"disas debug <SNR>\d\+_', @:) |
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
1183 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1184 " completion for the :match command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1185 call feedkeys(":match Search /pat/\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1186 call assert_equal("\"match Search /pat/\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1187 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1188 " completion for the :doautocmd command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1189 call feedkeys(":doautocmd User MyCmd a.c\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1190 call assert_equal("\"doautocmd User MyCmd a.c\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1191 |
22510
7060df0b8ebf
patch 8.2.1803: a few failures are not tested
Bram Moolenaar <Bram@vim.org>
parents:
22375
diff
changeset
|
1192 " completion of autocmd group after comma |
7060df0b8ebf
patch 8.2.1803: a few failures are not tested
Bram Moolenaar <Bram@vim.org>
parents:
22375
diff
changeset
|
1193 call feedkeys(":doautocmd BufNew,BufEn\<C-A>\<C-B>\"\<CR>", 'xt') |
7060df0b8ebf
patch 8.2.1803: a few failures are not tested
Bram Moolenaar <Bram@vim.org>
parents:
22375
diff
changeset
|
1194 call assert_equal("\"doautocmd BufNew,BufEnter", @:) |
7060df0b8ebf
patch 8.2.1803: a few failures are not tested
Bram Moolenaar <Bram@vim.org>
parents:
22375
diff
changeset
|
1195 |
25617
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1196 " completion of file name in :doautocmd |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1197 call writefile([], 'Xvarfile1', 'D') |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1198 call writefile([], 'Xvarfile2', 'D') |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1199 call feedkeys(":doautocmd BufEnter Xvarfi\<C-A>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1200 call assert_equal("\"doautocmd BufEnter Xvarfile1 Xvarfile2", @:) |
25617
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1201 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1202 " completion for the :augroup command |
25713
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
1203 augroup XTest.test |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1204 augroup END |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1205 call feedkeys(":augroup X\<C-A>\<C-B>\"\<CR>", 'xt') |
25713
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
1206 call assert_equal("\"augroup XTest.test", @:) |
29054
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1207 |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1208 " group name completion in :autocmd |
25713
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
1209 call feedkeys(":au X\<C-A>\<C-B>\"\<CR>", 'xt') |
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
1210 call assert_equal("\"au XTest.test", @:) |
29054
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1211 call feedkeys(":au XTest.test\<Tab>\<C-B>\"\<CR>", 'xt') |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1212 call assert_equal("\"au XTest.test", @:) |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1213 |
25713
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
1214 augroup! XTest.test |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1215 |
29054
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1216 " autocmd pattern completion |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1217 call feedkeys(":au BufEnter *.py\<Tab>\<C-B>\"\<CR>", 'xt') |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1218 call assert_equal("\"au BufEnter *.py\t", @:) |
e7bd4c788053
patch 8.2.5049: insufficient tests for autocommands
Bram Moolenaar <Bram@vim.org>
parents:
28905
diff
changeset
|
1219 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1220 " completion for the :unlet command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1221 call feedkeys(":unlet one two\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1222 call assert_equal("\"unlet one two", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1223 |
25994
e8873138ffbb
patch 8.2.3530: ":buf {a}" fails while ":edit {a}" works
Bram Moolenaar <Bram@vim.org>
parents:
25792
diff
changeset
|
1224 " completion for the :buffer command with curlies |
25996
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1225 " FIXME: what should happen on MS-Windows? |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1226 if !has('win32') |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1227 edit \{someFile} |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1228 call feedkeys(":buf someFile\<C-A>\<C-B>\"\<CR>", 'xt') |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1229 call assert_equal("\"buf {someFile}", @:) |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1230 bwipe {someFile} |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
1231 endif |
25994
e8873138ffbb
patch 8.2.3530: ":buf {a}" fails while ":edit {a}" works
Bram Moolenaar <Bram@vim.org>
parents:
25792
diff
changeset
|
1232 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1233 " completion for the :bdelete command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1234 call feedkeys(":bdel a b c\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1235 call assert_equal("\"bdel a b c", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1236 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1237 " completion for the :mapclear command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1238 call feedkeys(":mapclear \<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1239 call assert_equal("\"mapclear <buffer>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1240 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1241 " completion for user defined commands with menu names |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1242 menu Test.foo :ls<CR> |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1243 com -nargs=* -complete=menu MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1244 call feedkeys(":MyCmd Te\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1245 call assert_equal('"MyCmd Test.', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1246 delcom MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1247 unmenu Test |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1248 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1249 " completion for user defined commands with mappings |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1250 mapclear |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1251 map <F3> :ls<CR> |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1252 com -nargs=* -complete=mapping MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1253 call feedkeys(":MyCmd <F\<C-A>\<C-B>\"\<CR>", 'xt') |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1254 call assert_equal('"MyCmd <F3> <F4>', @:) |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1255 mapclear |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1256 delcom MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1257 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1258 " completion for :set path= with multiple backslashes |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1259 call feedkeys(":set path=a\\\\\\ b\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1260 call assert_equal('"set path=a\\\ b', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1261 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1262 " completion for :set dir= with a backslash |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1263 call feedkeys(":set dir=a\\ b\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1264 call assert_equal('"set dir=a\ b', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1265 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1266 " completion for the :py3 commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1267 call feedkeys(":py3\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1268 call assert_equal('"py3 py3do py3file', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1269 |
24256
b471a413d36a
patch 8.2.2669: command line completion does not work after "vim9"
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
1270 " completion for the :vim9 commands |
b471a413d36a
patch 8.2.2669: command line completion does not work after "vim9"
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
1271 call feedkeys(":vim9\<C-A>\<C-B>\"\<CR>", 'xt') |
b471a413d36a
patch 8.2.2669: command line completion does not work after "vim9"
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
1272 call assert_equal('"vim9cmd vim9script', @:) |
b471a413d36a
patch 8.2.2669: command line completion does not work after "vim9"
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
1273 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1274 " redir @" is not the start of a comment. So complete after that |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1275 call feedkeys(":redir @\" | cwin\t\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1276 call assert_equal('"redir @" | cwindow', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1277 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1278 " completion after a backtick |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1279 call feedkeys(":e `a1b2c\t\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1280 call assert_equal('"e `a1b2c', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1281 |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1282 " completion for :language command with an invalid argument |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1283 call feedkeys(":language dummy \t\<C-B>\"\<CR>", 'xt') |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1284 call assert_equal("\"language dummy \t", @:) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1285 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1286 " completion for commands after a :global command |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19689
diff
changeset
|
1287 call feedkeys(":g/a\\xb/clearj\t\<C-B>\"\<CR>", 'xt') |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19689
diff
changeset
|
1288 call assert_equal('"g/a\xb/clearjumps', @:) |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1289 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1290 " completion with ambiguous user defined commands |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1291 com TCmd1 echo 'TCmd1' |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1292 com TCmd2 echo 'TCmd2' |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1293 call feedkeys(":TCmd \t\<C-B>\"\<CR>", 'xt') |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1294 call assert_equal('"TCmd ', @:) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1295 delcom TCmd1 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1296 delcom TCmd2 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1297 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1298 " completion after a range followed by a pipe (|) character |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1299 call feedkeys(":1,10 | chist\t\<C-B>\"\<CR>", 'xt') |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1300 call assert_equal('"1,10 | chistory', @:) |
22169
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1301 |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1302 " completion after a :global command |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1303 call feedkeys(":g/a/chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1304 call assert_equal('"g/a/chistory', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1305 call feedkeys(":g/a\\/chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1306 call assert_equal("\"g/a\\/chist\t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1307 |
22169
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1308 " use <Esc> as the 'wildchar' for completion |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1309 set wildchar=<Esc> |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1310 call feedkeys(":g/a\\xb/clearj\<Esc>\<C-B>\"\<CR>", 'xt') |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1311 call assert_equal('"g/a\xb/clearjumps', @:) |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1312 " pressing <esc> twice should cancel the command |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1313 call feedkeys(":chist\<Esc>\<Esc>", 'xt') |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1314 call assert_equal('"g/a\xb/clearjumps', @:) |
53ed9f8a843f
patch 8.2.1634: loop to handle keys for the command line is too long
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1315 set wildchar& |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1316 |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1317 if has('unix') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1318 " should be able to complete a file name that starts with a '~'. |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1319 call writefile([], '~Xtest') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1320 call feedkeys(":e \\~X\<Tab>\<C-B>\"\<CR>", 'xt') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1321 call assert_equal('"e \~Xtest', @:) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1322 call delete('~Xtest') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1323 |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1324 " should be able to complete a file name that has a '*' |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1325 call writefile([], 'Xx*Yy') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1326 call feedkeys(":e Xx\*\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1327 call assert_equal('"e Xx\*Yy', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1328 call delete('Xx*Yy') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
1329 |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
1330 " use a literal star |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
1331 call feedkeys(":e \\*\<Tab>\<C-B>\"\<CR>", 'xt') |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
1332 call assert_equal('"e \*', @:) |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1333 endif |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1334 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1335 call feedkeys(":py3f\<Tab>\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1336 call assert_equal('"py3file', @:) |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1337 endfunc |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1338 |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1339 " Test for 'wildignorecase' |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1340 func Test_cmdline_wildignorecase() |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1341 CheckUnix |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1342 call writefile([], 'XTEST', 'D') |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1343 set wildignorecase |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1344 call feedkeys(":e xt\<Tab>\<C-B>\"\<CR>", 'xt') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1345 call assert_equal('"e XTEST', @:) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1346 call assert_equal(['XTEST'], getcompletion('xt', 'file')) |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1347 let g:Sline = '' |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1348 call feedkeys(":e xt\<C-d>\<F4>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1349 call assert_equal('"e xt', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1350 call assert_equal('XTEST', g:Sline) |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1351 set wildignorecase& |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1352 endfunc |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1353 |
12706
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1354 func Test_cmdline_write_alternatefile() |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1355 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1356 call setline('.', ['one', 'two']) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1357 f foo.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1358 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1359 f #-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1360 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
|
1361 f #<-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1362 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
|
1363 f %< |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1364 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
|
1365 new |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22061
diff
changeset
|
1366 call assert_fails('f #<', 'E95:') |
12706
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1367 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1368 f foo-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1369 f %<-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1370 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
|
1371 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1372 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1373 endfunc |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1374 |
30049
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1375 func Test_cmdline_expand_cur_alt_file() |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1376 enew |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1377 file http://some.com/file.txt |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1378 call feedkeys(":e %\<Tab>\<C-B>\"\<CR>", 'xt') |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1379 call assert_equal('"e http://some.com/file.txt', @:) |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1380 edit another |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1381 call feedkeys(":e #\<Tab>\<C-B>\"\<CR>", 'xt') |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1382 call assert_equal('"e http://some.com/file.txt', @:) |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1383 bwipe |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1384 bwipe http://some.com/file.txt |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1385 endfunc |
f005dea14c8b
patch 9.0.0362: expanding ":e %" does not work for remote files
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
1386 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1387 " 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
|
1388 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
|
1389 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1390 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
|
1391 new |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1392 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
|
1393 /d |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1394 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
|
1395 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
|
1396 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1397 /a |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1398 $ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1399 \?,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
|
1400 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
|
1401 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1402 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
|
1403 %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
|
1404 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
|
1405 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
|
1406 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1407 let @/ = 'apple' |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21140
diff
changeset
|
1408 call assert_fails('\/print', ['E486:.*apple']) |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1409 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1410 bwipe! |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1411 endfunc |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1412 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1413 " Test for the tick mark (') in an excmd range |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1414 func Test_tick_mark_in_range() |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1415 " If only the tick is passed as a range and no command is specified, there |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1416 " should not be an error |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1417 call feedkeys(":'\<CR>", 'xt') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1418 call assert_equal("'", @:) |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1419 call assert_fails("',print", 'E78:') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1420 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1421 |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1422 " Test for using a line number followed by a search pattern as range |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1423 func Test_lnum_and_pattern_as_range() |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1424 new |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1425 call setline(1, ['foo 1', 'foo 2', 'foo 3']) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1426 let @" = '' |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1427 2/foo/yank |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1428 call assert_equal("foo 3\n", @") |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1429 call assert_equal(1, line('.')) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1430 close! |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1431 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1432 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1433 " 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
|
1434 func Check_cmdline(cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1435 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
|
1436 call assert_equal(8, getcmdpos()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1437 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
|
1438 return '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1439 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1440 |
18043
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1441 set cpo& |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1442 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1443 func Test_getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1444 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
|
1445 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1446 let cmdtype = '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1447 debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1448 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
|
1449 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
|
1450 call feedkeys("cont\<CR>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1451 0debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1452 call assert_equal('>', cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1453 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1454 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
|
1455 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
|
1456 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1457 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
|
1458 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
|
1459 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1460 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
|
1461 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1462 cnoremap <expr> <F6> Check_cmdline('=') |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1463 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
|
1464 cunmap <F6> |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1465 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1466 call assert_equal('', getcmdline()) |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1467 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1468 |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1469 func Test_verbosefile() |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1470 set verbosefile=Xlog |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1471 echomsg 'foo' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1472 echomsg 'bar' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1473 set verbosefile= |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1474 let log = readfile('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1475 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
|
1476 call delete('Xlog') |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1477 |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1478 call mkdir('Xdir', 'D') |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21140
diff
changeset
|
1479 call assert_fails('set verbosefile=Xdir', ['E484:.*Xdir', 'E474:']) |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1480 endfunc |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1481 |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1482 func Test_verbose_option() |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1483 CheckScreendump |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1484 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1485 let lines =<< trim [SCRIPT] |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1486 command DoSomething echo 'hello' |set ts=4 |let v = '123' |echo v |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1487 call feedkeys("\r", 't') " for the hit-enter prompt |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1488 set verbose=20 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1489 [SCRIPT] |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1490 call writefile(lines, 'XTest_verbose', 'D') |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1491 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1492 let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12}) |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
19852
diff
changeset
|
1493 call TermWait(buf, 50) |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1494 call term_sendkeys(buf, ":DoSomething\<CR>") |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1495 call VerifyScreenDump(buf, 'Test_verbose_option_1', {}) |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1496 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1497 " clean up |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1498 call StopVimInTerminal(buf) |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1499 endfunc |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1500 |
13890
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1501 func Test_setcmdpos() |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1502 func InsertTextAtPos(text, pos) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1503 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
|
1504 return a:text |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1505 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1506 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1507 " 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
|
1508 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
|
1509 call assert_equal('"1ab2', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1510 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1511 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
|
1512 call assert_equal('"1b2a', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1513 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1514 " 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
|
1515 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
|
1516 call assert_equal('"12ab', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1517 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1518 " setcmdpos() returns 1 when not editing the command line. |
17994
0dcc2ee838dd
patch 8.1.1993: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17857
diff
changeset
|
1519 call assert_equal(1, 3->setcmdpos()) |
13890
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1520 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1521 |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1522 func Test_cmdline_overstrike() |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1523 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
|
1524 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
|
1525 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1526 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
|
1527 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
|
1528 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1529 " 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
|
1530 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
1531 call assert_equal('"0ab1cd4', @:, e) |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1532 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1533 " 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
|
1534 call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cdefgh\<enter>", 'xt') |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
1535 call assert_equal('"0ab1cdefgh', @:, e) |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1536 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1537 " 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
|
1538 call feedkeys(":\"01234\<home>\<right>ab\<right>\<insert>cd\<right>\<insert>ef\<enter>", 'xt') |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
1539 call assert_equal('"ab0cd3ef4', @:, e) |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1540 endfor |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1541 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1542 " Test overstrike with multi-byte characters. |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1543 call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
1544 call assert_equal('"テabキcdエディタ', @:, e) |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1545 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1546 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
|
1547 endfunc |
18084
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1548 |
18463
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1549 func Test_buffers_lastused() |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1550 " check that buffers are sorted by time when wildmode has lastused |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1551 call test_settime(1550020000) " middle |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1552 edit bufa |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1553 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1554 call test_settime(1550030000) " newest |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1555 edit bufb |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1556 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1557 call test_settime(1550010000) " oldest |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1558 edit bufc |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1559 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1560 call test_settime(0) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1561 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1562 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1563 call assert_equal(['bufa', 'bufb', 'bufc'], |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1564 \ getcompletion('', 'buffer')) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1565 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1566 let save_wildmode = &wildmode |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1567 set wildmode=full:lastused |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1568 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1569 let cap = "\<c-r>=execute('let X=getcmdline()')\<cr>" |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1570 call feedkeys(":b \<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1571 call assert_equal('b bufb', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1572 call feedkeys(":b \<tab>\<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1573 call assert_equal('b bufa', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1574 call feedkeys(":b \<tab>\<tab>\<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1575 call assert_equal('b bufc', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1576 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1577 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1578 edit other |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1579 call feedkeys(":b \<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1580 call assert_equal('b bufb', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1581 call feedkeys(":b \<tab>\<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1582 call assert_equal('b bufa', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1583 call feedkeys(":b \<tab>\<tab>\<tab>" .. cap .. "\<esc>", 'xt') |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1584 call assert_equal('b bufc', X) |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1585 enew |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1586 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1587 let &wildmode = save_wildmode |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1588 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1589 bwipeout bufa |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1590 bwipeout bufb |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1591 bwipeout bufc |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1592 endfunc |
18793
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1593 |
19143
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1594 func Test_cmdlineclear_tabenter() |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1595 CheckScreendump |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1596 |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1597 let lines =<< trim [SCRIPT] |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1598 call setline(1, range(30)) |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1599 [SCRIPT] |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1600 |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1601 call writefile(lines, 'XtestCmdlineClearTabenter', 'D') |
19143
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1602 let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10}) |
19954
c087099e9163
patch 8.2.0533: tests using term_wait() can still be flaky
Bram Moolenaar <Bram@vim.org>
parents:
19852
diff
changeset
|
1603 call TermWait(buf, 25) |
19143
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1604 " in one tab make the command line higher with CTRL-W - |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1605 call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt") |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1606 call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {}) |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1607 |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1608 call StopVimInTerminal(buf) |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1609 endfunc |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1610 |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1611 " Test for expanding special keywords in cmdline |
19370
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1612 func Test_cmdline_expand_special() |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1613 %bwipe! |
25654
ef38fc02faaa
patch 8.2.3363: when :edit reuses the current buffer the alternate file is set
Bram Moolenaar <Bram@vim.org>
parents:
25648
diff
changeset
|
1614 call assert_fails('e #', 'E194:') |
19370
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1615 call assert_fails('e <afile>', 'E495:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1616 call assert_fails('e <abuf>', 'E496:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1617 call assert_fails('e <amatch>', 'E497:') |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1618 |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1619 call writefile([], 'Xfile.cpp', 'D') |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1620 call writefile([], 'Xfile.java', 'D') |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1621 new Xfile.cpp |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1622 call feedkeys(":e %:r\<C-A>\<C-B>\"\<CR>", 'xt') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1623 call assert_equal('"e Xfile.cpp Xfile.java', @:) |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1624 close |
19370
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1625 endfunc |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1626 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1627 " Test for backtick expression in the command line |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1628 func Test_cmd_backtick() |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1629 %argd |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1630 argadd `=['a', 'b', 'c']` |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1631 call assert_equal(['a', 'b', 'c'], argv()) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1632 %argd |
25617
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1633 |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1634 argadd `echo abc def` |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1635 call assert_equal(['abc def'], argv()) |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1636 %argd |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1637 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1638 |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1639 " Test for the :! command |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1640 func Test_cmd_bang() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1641 CheckUnix |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1642 |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1643 let lines =<< trim [SCRIPT] |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1644 " Test for no previous command |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1645 call assert_fails('!!', 'E34:') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1646 set nomore |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1647 " Test for cmdline expansion with :! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1648 call setline(1, 'foo!') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1649 silent !echo <cWORD> > Xfile.out |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1650 call assert_equal(['foo!'], readfile('Xfile.out')) |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1651 " Test for using previous command |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1652 silent !echo \! ! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1653 call assert_equal(['! echo foo!'], readfile('Xfile.out')) |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1654 call writefile(v:errors, 'Xresult') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1655 call delete('Xfile.out') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1656 qall! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1657 [SCRIPT] |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1658 call writefile(lines, 'Xscript', 'D') |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1659 if RunVim([], [], '--clean -S Xscript') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1660 call assert_equal([], readfile('Xresult')) |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1661 endif |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1662 call delete('Xresult') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1663 endfunc |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1664 |
20703
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1665 " Test error: "E135: *Filter* Autocommands must not change current buffer" |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1666 func Test_cmd_bang_E135() |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1667 new |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1668 call setline(1, ['a', 'b', 'c', 'd']) |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1669 augroup test_cmd_filter_E135 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1670 au! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1671 autocmd FilterReadPost * help |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1672 augroup END |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1673 call assert_fails('2,3!echo "x"', 'E135:') |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1674 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1675 augroup test_cmd_filter_E135 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1676 au! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1677 augroup END |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1678 %bwipe! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1679 endfunc |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1680 |
31020
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1681 func Test_cmd_bang_args() |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1682 new |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1683 :.! |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1684 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1685 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1686 " Note that below there is one space char after the '!'. This caused a |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1687 " shell error in the past, see https://github.com/vim/vim/issues/11495. |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1688 :.! |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1689 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1690 bwipe! |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1691 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1692 CheckUnix |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1693 :.!pwd |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1694 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1695 :.! pwd |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1696 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1697 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1698 " Note there is one space after 'pwd'. |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1699 :.! pwd |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1700 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1701 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1702 " Note there are two spaces after 'pwd'. |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1703 :.! pwd |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1704 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1705 :.!ls ~ |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1706 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1707 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1708 " Note there is one space char after '~'. |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1709 :.!ls ~ |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1710 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1711 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1712 " Note there are two spaces after '~'. |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1713 :.!ls ~ |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1714 call assert_equal(0, v:shell_error) |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1715 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1716 :.!echo "foo" |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1717 call assert_equal(getline('.'), "foo") |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1718 :.!echo "foo " |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1719 call assert_equal(getline('.'), "foo ") |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1720 :.!echo " foo " |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1721 call assert_equal(getline('.'), " foo ") |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1722 :.!echo " foo " |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1723 call assert_equal(getline('.'), " foo ") |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1724 |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1725 %bwipe! |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1726 endfunc |
b0596e8ee3c0
patch 9.0.0845: shell command with just space gives strange error
Bram Moolenaar <Bram@vim.org>
parents:
30671
diff
changeset
|
1727 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1728 " Test for using ~ for home directory in cmdline completion matches |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1729 func Test_cmdline_expand_home() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1730 call mkdir('Xexpdir', 'R') |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1731 call writefile([], 'Xexpdir/Xfile1') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1732 call writefile([], 'Xexpdir/Xfile2') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1733 cd Xexpdir |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1734 let save_HOME = $HOME |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1735 let $HOME = getcwd() |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1736 call feedkeys(":e ~/\<C-A>\<C-B>\"\<CR>", 'xt') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1737 call assert_equal('"e ~/Xfile1 ~/Xfile2', @:) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1738 let $HOME = save_HOME |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1739 cd .. |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1740 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1741 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1742 " Test for using CTRL-\ CTRL-G in the command line to go back to normal mode |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1743 " or insert mode (when 'insertmode' is set) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1744 func Test_cmdline_ctrl_g() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1745 new |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1746 call setline(1, 'abc') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1747 call cursor(1, 3) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1748 " If command line is entered from insert mode, using C-\ C-G should back to |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1749 " insert mode |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1750 call feedkeys("i\<C-O>:\<C-\>\<C-G>xy", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1751 call assert_equal('abxyc', getline(1)) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1752 call assert_equal(4, col('.')) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1753 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1754 " If command line is entered in 'insertmode', using C-\ C-G should back to |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1755 " 'insertmode' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1756 call feedkeys(":set im\<cr>\<C-L>:\<C-\>\<C-G>12\<C-L>:set noim\<cr>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1757 call assert_equal('ab12xyc', getline(1)) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1758 close! |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1759 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1760 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1761 " Test for 'wildmode' |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1762 func Wildmode_tests() |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1763 func T(a, c, p) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1764 return "oneA\noneB\noneC" |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1765 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1766 command -nargs=1 -complete=custom,T MyCmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1767 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1768 set nowildmenu |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1769 set wildmode=full,list |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1770 let g:Sline = '' |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1771 call feedkeys(":MyCmd \t\t\<F4>\<C-B>\"\<CR>", 'xt') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1772 call assert_equal('oneA oneB oneC', g:Sline) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1773 call assert_equal('"MyCmd oneA', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1774 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1775 set wildmode=longest,full |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1776 call feedkeys(":MyCmd o\t\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1777 call assert_equal('"MyCmd one', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1778 call feedkeys(":MyCmd o\t\t\t\t\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1779 call assert_equal('"MyCmd oneC', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1780 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1781 set wildmode=longest |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1782 call feedkeys(":MyCmd one\t\t\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1783 call assert_equal('"MyCmd one', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1784 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1785 set wildmode=list:longest |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1786 let g:Sline = '' |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1787 call feedkeys(":MyCmd \t\<F4>\<C-B>\"\<CR>", 'xt') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1788 call assert_equal('oneA oneB oneC', g:Sline) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1789 call assert_equal('"MyCmd one', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1790 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1791 set wildmode="" |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1792 call feedkeys(":MyCmd \t\t\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1793 call assert_equal('"MyCmd oneA', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1794 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1795 " Test for wildmode=longest with 'fileignorecase' set |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1796 set wildmode=longest |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1797 set fileignorecase |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1798 argadd AAA AAAA AAAAA |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1799 call feedkeys(":buffer a\t\<C-B>\"\<CR>", 'xt') |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1800 call assert_equal('"buffer AAA', @:) |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1801 set fileignorecase& |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1802 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1803 " Test for listing files with wildmode=list |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1804 set wildmode=list |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1805 let g:Sline = '' |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1806 call feedkeys(":b A\t\t\<F4>\<C-B>\"\<CR>", 'xt') |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1807 call assert_equal('AAA AAAA AAAAA', g:Sline) |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1808 call assert_equal('"b A', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1809 |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1810 " when using longest completion match, matches shorter than the argument |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1811 " should be ignored (happens with :help) |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1812 set wildmode=longest,full |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1813 set wildmenu |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1814 call feedkeys(":help a*\t\<C-B>\"\<CR>", 'xt') |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1815 call assert_equal('"help a', @:) |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1816 " non existing file |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1817 call feedkeys(":e a1b2y3z4\t\<C-B>\"\<CR>", 'xt') |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1818 call assert_equal('"e a1b2y3z4', @:) |
27680
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1819 set wildmenu& |
38eab98ef5a9
patch 8.2.4366: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27641
diff
changeset
|
1820 |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1821 " Test for longest file name completion with 'fileignorecase' |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1822 " On MS-Windows, file names are case insensitive. |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1823 if has('unix') |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1824 call writefile([], 'XTESTfoo', 'D') |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1825 call writefile([], 'Xtestbar', 'D') |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1826 set nofileignorecase |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1827 call feedkeys(":e XT\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1828 call assert_equal('"e XTESTfoo', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1829 call feedkeys(":e Xt\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1830 call assert_equal('"e Xtestbar', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1831 set fileignorecase |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1832 call feedkeys(":e XT\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1833 call assert_equal('"e Xtest', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1834 call feedkeys(":e Xt\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1835 call assert_equal('"e Xtest', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1836 set fileignorecase& |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1837 endif |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1838 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1839 %argdelete |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1840 delcommand MyCmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1841 delfunc T |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1842 set wildmode& |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1843 %bwipe! |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1844 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1845 |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1846 func Test_wildmode() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1847 " Test with utf-8 encoding |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1848 call Wildmode_tests() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1849 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1850 " Test with latin1 encoding |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1851 let save_encoding = &encoding |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1852 set encoding=latin1 |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1853 call Wildmode_tests() |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1854 let &encoding = save_encoding |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1855 endfunc |
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
1856 |
28119
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1857 func Test_custom_complete_autoload() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
1858 call mkdir('Xcustdir/autoload', 'pR') |
28119
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1859 let save_rtp = &rtp |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1860 exe 'set rtp=' .. getcwd() .. '/Xcustdir' |
28119
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1861 let lines =<< trim END |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1862 func vim8#Complete(a, c, p) |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1863 return "oneA\noneB\noneC" |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1864 endfunc |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1865 END |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
1866 call writefile(lines, 'Xcustdir/autoload/vim8.vim') |
28119
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1867 |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1868 command -nargs=1 -complete=custom,vim8#Complete MyCmd |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1869 set nowildmenu |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1870 set wildmode=full,list |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1871 call feedkeys(":MyCmd \<C-A>\<C-B>\"\<CR>", 'xt') |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1872 call assert_equal('"MyCmd oneA oneB oneC', @:) |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1873 |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1874 let &rtp = save_rtp |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1875 set wildmode& wildmenu& |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1876 delcommand MyCmd |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1877 endfunc |
57ea74314c1b
patch 8.2.4584: error for using autoload function in custom completion
Bram Moolenaar <Bram@vim.org>
parents:
28109
diff
changeset
|
1878 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1879 " Test for interrupting the command-line completion |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1880 func Test_interrupt_compl() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1881 func F(lead, cmdl, p) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1882 if a:lead =~ 'tw' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1883 call interrupt() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1884 return |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1885 endif |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1886 return "one\ntwo\nthree" |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1887 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1888 command -nargs=1 -complete=custom,F Tcmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1889 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1890 set nowildmenu |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1891 set wildmode=full |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1892 let interrupted = 0 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1893 try |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1894 call feedkeys(":Tcmd tw\<Tab>\<C-B>\"\<CR>", 'xt') |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1895 catch /^Vim:Interrupt$/ |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1896 let interrupted = 1 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1897 endtry |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1898 call assert_equal(1, interrupted) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1899 |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1900 let interrupted = 0 |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1901 try |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1902 call feedkeys(":Tcmd tw\<C-d>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1903 catch /^Vim:Interrupt$/ |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1904 let interrupted = 1 |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1905 endtry |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1906 call assert_equal(1, interrupted) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
1907 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1908 delcommand Tcmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1909 delfunc F |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1910 set wildmode& |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1911 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1912 |
19550
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1913 " Test for moving the cursor on the : command line |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1914 func Test_cmdline_edit() |
19550
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1915 let str = ":one two\<C-U>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1916 let str ..= "one two\<C-W>\<C-W>" |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1917 let str ..= "four\<BS>\<C-H>\<Del>\<kDel>" |
19550
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1918 let str ..= "\<Left>five\<Right>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1919 let str ..= "\<Home>two " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1920 let str ..= "\<C-Left>one " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1921 let str ..= "\<C-Right> three" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1922 let str ..= "\<End>\<S-Left>four " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1923 let str ..= "\<S-Right> six" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1924 let str ..= "\<C-B>\"\<C-E> seven\<CR>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1925 call feedkeys(str, 'xt') |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1926 call assert_equal("\"one two three four five six seven", @:) |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1927 endfunc |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1928 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1929 " Test for moving the cursor on the / command line in 'rightleft' mode |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1930 func Test_cmdline_edit_rightleft() |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1931 CheckFeature rightleft |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1932 set rightleft |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1933 set rightleftcmd=search |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1934 let str = "/one two\<C-U>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1935 let str ..= "one two\<C-W>\<C-W>" |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1936 let str ..= "four\<BS>\<C-H>\<Del>\<kDel>" |
19550
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1937 let str ..= "\<Right>five\<Left>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1938 let str ..= "\<Home>two " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1939 let str ..= "\<C-Right>one " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1940 let str ..= "\<C-Left> three" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1941 let str ..= "\<End>\<S-Right>four " |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1942 let str ..= "\<S-Left> six" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1943 let str ..= "\<C-B>\"\<C-E> seven\<CR>" |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1944 call assert_fails("call feedkeys(str, 'xt')", 'E486:') |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1945 call assert_equal("\"one two three four five six seven", @/) |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1946 set rightleftcmd& |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1947 set rightleft& |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1948 endfunc |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1949 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1950 " Test for using <C-\>e in the command line to evaluate an expression |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1951 func Test_cmdline_expr() |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1952 " Evaluate an expression from the beginning of a command line |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1953 call feedkeys(":abc\<C-B>\<C-\>e\"\\\"hello\"\<CR>\<CR>", 'xt') |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1954 call assert_equal('"hello', @:) |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1955 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1956 " Use an invalid expression for <C-\>e |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1957 call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")') |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1958 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1959 " Insert literal <CTRL-\> in the command line |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1960 call feedkeys(":\"e \<C-\>\<C-Y>\<CR>", 'xt') |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1961 call assert_equal("\"e \<C-\>\<C-Y>", @:) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1962 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1963 |
29259
a5846b82119b
patch 8.2.5148: invalid memory access when using expression on command line
Bram Moolenaar <Bram@vim.org>
parents:
29083
diff
changeset
|
1964 " This was making the insert position negative |
a5846b82119b
patch 8.2.5148: invalid memory access when using expression on command line
Bram Moolenaar <Bram@vim.org>
parents:
29083
diff
changeset
|
1965 func Test_cmdline_expr_register() |
a5846b82119b
patch 8.2.5148: invalid memory access when using expression on command line
Bram Moolenaar <Bram@vim.org>
parents:
29083
diff
changeset
|
1966 exe "sil! norm! ?\<C-\>e0\<C-R>0\<Esc>?\<C-\>e0\<CR>" |
a5846b82119b
patch 8.2.5148: invalid memory access when using expression on command line
Bram Moolenaar <Bram@vim.org>
parents:
29083
diff
changeset
|
1967 endfunc |
a5846b82119b
patch 8.2.5148: invalid memory access when using expression on command line
Bram Moolenaar <Bram@vim.org>
parents:
29083
diff
changeset
|
1968 |
19570
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1969 " Test for 'imcmdline' and 'imsearch' |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1970 " This test doesn't actually test the input method functionality. |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1971 func Test_cmdline_inputmethod() |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1972 new |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1973 call setline(1, ['', 'abc', '']) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1974 set imcmdline |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1975 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1976 call feedkeys(":\"abc\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1977 call assert_equal("\"abc", @:) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1978 call feedkeys(":\"\<C-^>abc\<C-^>\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1979 call assert_equal("\"abc", @:) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1980 call feedkeys("/abc\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1981 call assert_equal([2, 1], [line('.'), col('.')]) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1982 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1983 call assert_equal([2, 1], [line('.'), col('.')]) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1984 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1985 set imsearch=2 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1986 call cursor(1, 1) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1987 call feedkeys("/abc\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1988 call assert_equal([2, 1], [line('.'), col('.')]) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1989 call cursor(1, 1) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1990 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1991 call assert_equal([2, 1], [line('.'), col('.')]) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1992 set imdisable |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1993 call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt') |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1994 call assert_equal([2, 1], [line('.'), col('.')]) |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1995 set imdisable& |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1996 set imsearch& |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1997 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1998 set imcmdline& |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1999 %bwipe! |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
2000 endfunc |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
2001 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2002 " Test for using CTRL-_ in the command line with 'allowrevins' |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2003 func Test_cmdline_revins() |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2004 CheckNotMSWindows |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2005 CheckFeature rightleft |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2006 call feedkeys(":\"abc\<c-_>\<cr>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2007 call assert_equal("\"abc\<c-_>", @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2008 set allowrevins |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2009 call feedkeys(":\"abc\<c-_>xyz\<c-_>\<CR>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2010 call assert_equal('"abcñèæ', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2011 set allowrevins& |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2012 endfunc |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2013 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2014 " Test for typing UTF-8 composing characters in the command line |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2015 func Test_cmdline_composing_chars() |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2016 call feedkeys(":\"\<C-V>u3046\<C-V>u3099\<CR>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2017 call assert_equal('"ゔ', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2018 endfunc |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
2019 |
20185
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2020 " test that ";" works to find a match at the start of the first line |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2021 func Test_zero_line_search() |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2022 new |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2023 call setline(1, ["1, pattern", "2, ", "3, pattern"]) |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2024 call cursor(1,1) |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2025 0;/pattern/d |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2026 call assert_equal(["2, ", "3, pattern"], getline(1,'$')) |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2027 q! |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2028 endfunc |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
2029 |
20911
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2030 func Test_read_shellcmd() |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2031 CheckUnix |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2032 if executable('ls') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2033 " There should be ls in the $PATH |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2034 call feedkeys(":r! l\<c-a>\<c-b>\"\<cr>", 'tx') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2035 call assert_match('^"r! .*\<ls\>', @:) |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2036 endif |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2037 |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2038 if executable('rm') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2039 call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2040 call assert_notmatch('^"r!.*\<runtest.vim\>', @:) |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2041 call assert_match('^"r!.*\<rm\>', @:) |
21140
f86140ad0164
patch 8.2.1121: command completion not working after ++arg
Bram Moolenaar <Bram@vim.org>
parents:
21052
diff
changeset
|
2042 |
f86140ad0164
patch 8.2.1121: command completion not working after ++arg
Bram Moolenaar <Bram@vim.org>
parents:
21052
diff
changeset
|
2043 call feedkeys(":r ++enc=utf-8 !rm\<c-a>\<c-b>\"\<cr>", 'tx') |
f86140ad0164
patch 8.2.1121: command completion not working after ++arg
Bram Moolenaar <Bram@vim.org>
parents:
21052
diff
changeset
|
2044 call assert_notmatch('^"r.*\<runtest.vim\>', @:) |
f86140ad0164
patch 8.2.1121: command completion not working after ++arg
Bram Moolenaar <Bram@vim.org>
parents:
21052
diff
changeset
|
2045 call assert_match('^"r ++enc\S\+ !.*\<rm\>', @:) |
20911
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2046 endif |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2047 endfunc |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
2048 |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2049 " Test for going up and down the directory tree using 'wildmenu' |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2050 func Test_wildmenu_dirstack() |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2051 CheckUnix |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2052 %bw! |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2053 call mkdir('Xwildmenu/dir2/dir3/dir4', 'pR') |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2054 call writefile([], 'Xwildmenu/file1_1.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2055 call writefile([], 'Xwildmenu/file1_2.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2056 call writefile([], 'Xwildmenu/dir2/file2_1.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2057 call writefile([], 'Xwildmenu/dir2/file2_2.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2058 call writefile([], 'Xwildmenu/dir2/dir3/file3_1.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2059 call writefile([], 'Xwildmenu/dir2/dir3/file3_2.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2060 call writefile([], 'Xwildmenu/dir2/dir3/dir4/file4_1.txt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2061 call writefile([], 'Xwildmenu/dir2/dir3/dir4/file4_2.txt') |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2062 set wildmenu |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2063 |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2064 cd Xwildmenu/dir2/dir3/dir4 |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2065 call feedkeys(":e \<Tab>\<C-B>\"\<CR>", 'xt') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2066 call assert_equal('"e file4_1.txt', @:) |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2067 call feedkeys(":e \<Tab>\<Up>\<C-B>\"\<CR>", 'xt') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2068 call assert_equal('"e ../dir4/', @:) |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2069 call feedkeys(":e \<Tab>\<Up>\<Up>\<C-B>\"\<CR>", 'xt') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2070 call assert_equal('"e ../../dir3/', @:) |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2071 call feedkeys(":e \<Tab>\<Up>\<Up>\<Up>\<C-B>\"\<CR>", 'xt') |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2072 call assert_equal('"e ../../../dir2/', @:) |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2073 call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<C-B>\"\<CR>", 'xt') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2074 call assert_equal('"e ../../dir3/dir4/', @:) |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2075 call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') |
27744
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2076 call assert_equal('"e ../../dir3/dir4/file4_1.txt', @:) |
515ce8e07bf2
patch 8.2.4398: some command completion functions are too long
Bram Moolenaar <Bram@vim.org>
parents:
27722
diff
changeset
|
2077 cd - |
29970
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2078 call feedkeys(":e Xwildmenu/\<Tab>\<Down>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2079 call assert_equal('"e Xwildmenu/dir2/dir3/dir4/file4_1.txt', @:) |
d891115c0aea
patch 9.0.0323: using common name in tests leads to flaky tests
Bram Moolenaar <Bram@vim.org>
parents:
29964
diff
changeset
|
2080 |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2081 set wildmenu& |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2082 endfunc |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
2083 |
24622
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2084 " Test for recalling newer or older cmdline from history with <Up>, <Down>, |
28121
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2085 " <S-Up>, <S-Down>, <PageUp>, <PageDown>, <kPageUp>, <kPageDown>, <C-p>, or |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2086 " <C-n>. |
24622
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2087 func Test_recalling_cmdline() |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2088 CheckFeature cmdline_hist |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2089 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2090 let g:cmdlines = [] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2091 cnoremap <Plug>(save-cmdline) <Cmd>let g:cmdlines += [getcmdline()]<CR> |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2092 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2093 let histories = [ |
28121
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2094 \ #{name: 'cmd', enter: ':', exit: "\<Esc>"}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2095 \ #{name: 'search', enter: '/', exit: "\<Esc>"}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2096 \ #{name: 'expr', enter: ":\<C-r>=", exit: "\<Esc>\<Esc>"}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2097 \ #{name: 'input', enter: ":call input('')\<CR>", exit: "\<CR>"}, |
24622
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2098 "\ TODO: {'name': 'debug', ...} |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2099 \] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2100 let keypairs = [ |
28121
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2101 \ #{older: "\<Up>", newer: "\<Down>", prefixmatch: v:true}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2102 \ #{older: "\<S-Up>", newer: "\<S-Down>", prefixmatch: v:false}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2103 \ #{older: "\<PageUp>", newer: "\<PageDown>", prefixmatch: v:false}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2104 \ #{older: "\<kPageUp>", newer: "\<kPageDown>", prefixmatch: v:false}, |
4765d97b4d8b
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Bram Moolenaar <Bram@vim.org>
parents:
28119
diff
changeset
|
2105 \ #{older: "\<C-p>", newer: "\<C-n>", prefixmatch: v:false}, |
24622
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2106 \] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2107 let prefix = 'vi' |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2108 for h in histories |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2109 call histadd(h.name, 'vim') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2110 call histadd(h.name, 'virtue') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2111 call histadd(h.name, 'Virgo') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2112 call histadd(h.name, 'vogue') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2113 call histadd(h.name, 'emacs') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2114 for k in keypairs |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2115 let g:cmdlines = [] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2116 let keyseqs = h.enter |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2117 \ .. prefix |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2118 \ .. repeat(k.older .. "\<Plug>(save-cmdline)", 2) |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2119 \ .. repeat(k.newer .. "\<Plug>(save-cmdline)", 2) |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2120 \ .. h.exit |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2121 call feedkeys(keyseqs, 'xt') |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2122 call histdel(h.name, -1) " delete the history added by feedkeys above |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2123 let expect = k.prefixmatch |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2124 \ ? ['virtue', 'vim', 'virtue', prefix] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2125 \ : ['emacs', 'vogue', 'emacs', prefix] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2126 call assert_equal(expect, g:cmdlines) |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2127 endfor |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2128 endfor |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2129 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2130 unlet g:cmdlines |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2131 cunmap <Plug>(save-cmdline) |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2132 endfunc |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
2133 |
24624
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2134 func Test_cmd_map_cmdlineChanged() |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2135 let g:log = [] |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2136 cnoremap <F1> l<Cmd><CR>s |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2137 augroup test |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2138 autocmd! |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2139 autocmd CmdlineChanged : let g:log += [getcmdline()] |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2140 augroup END |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2141 |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2142 call feedkeys(":\<F1>\<CR>", 'xt') |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2143 call assert_equal(['l', 'ls'], g:log) |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2144 |
24663
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2145 let @b = 'b' |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2146 cnoremap <F1> a<C-R>b |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2147 let g:log = [] |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2148 call feedkeys(":\<F1>\<CR>", 'xt') |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2149 call assert_equal(['a', 'ab'], g:log) |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
2150 |
24624
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2151 unlet g:log |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2152 cunmap <F1> |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2153 augroup test |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2154 autocmd! |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2155 augroup END |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2156 endfunc |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2157 |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2158 " Test for the 'suffixes' option |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2159 func Test_suffixes_opt() |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2160 call writefile([], 'Xsuffile', 'D') |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2161 call writefile([], 'Xsuffile.c', 'D') |
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2162 call writefile([], 'Xsuffile.o', 'D') |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2163 set suffixes= |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2164 call feedkeys(":e Xsuffi*\<C-A>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2165 call assert_equal('"e Xsuffile Xsuffile.c Xsuffile.o', @:) |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2166 call feedkeys(":e Xsuffi*\<Tab>\<Tab>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2167 call assert_equal('"e Xsuffile.c', @:) |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2168 set suffixes=.c |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2169 call feedkeys(":e Xsuffi*\<C-A>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2170 call assert_equal('"e Xsuffile Xsuffile.o Xsuffile.c', @:) |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2171 call feedkeys(":e Xsuffi*\<Tab>\<Tab>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2172 call assert_equal('"e Xsuffile.o', @:) |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2173 set suffixes=,, |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2174 call feedkeys(":e Xsuffi*\<C-A>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2175 call assert_equal('"e Xsuffile.c Xsuffile.o Xsuffile', @:) |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2176 call feedkeys(":e Xsuffi*\<Tab>\<Tab>\<C-B>\"\<CR>", 'xt') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2177 call assert_equal('"e Xsuffile.o', @:) |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2178 set suffixes& |
27700
3f57b0a8cd29
patch 8.2.4376: not enough tests for command line completion
Bram Moolenaar <Bram@vim.org>
parents:
27680
diff
changeset
|
2179 " Test for getcompletion() with different patterns |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2180 call assert_equal(['Xsuffile', 'Xsuffile.c', 'Xsuffile.o'], getcompletion('Xsuffile', 'file')) |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2181 call assert_equal(['Xsuffile'], getcompletion('Xsuffile$', 'file')) |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
2182 endfunc |
24624
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
2183 |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2184 " Test for using a popup menu for the command line completion matches |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2185 " (wildoptions=pum) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2186 func Test_wildmenu_pum() |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2187 CheckRunVimInTerminal |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2188 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2189 let commands =<< trim [CODE] |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2190 set wildmenu |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2191 set wildoptions=pum |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2192 set shm+=I |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2193 set noruler |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2194 set noshowcmd |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2195 |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2196 func CmdCompl(a, b, c) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2197 return repeat(['aaaa'], 120) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2198 endfunc |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2199 command -nargs=* -complete=customlist,CmdCompl Tcmd |
27641
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2200 |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2201 func MyStatusLine() abort |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2202 return 'status' |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2203 endfunc |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2204 func SetupStatusline() |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2205 set statusline=%!MyStatusLine() |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2206 set laststatus=2 |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2207 endfunc |
27712
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2208 |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2209 func MyTabLine() |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2210 return 'my tab line' |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2211 endfunc |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2212 func SetupTabline() |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2213 set statusline= |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2214 set tabline=%!MyTabLine() |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2215 set showtabline=2 |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2216 endfunc |
27912
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2217 |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2218 func DoFeedKeys() |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2219 let &wildcharm = char2nr("\t") |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2220 call feedkeys(":edit $VIMRUNTIME/\<Tab>\<Left>\<C-U>ab\<Tab>") |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2221 endfunc |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2222 [CODE] |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2223 call writefile(commands, 'Xtest', 'D') |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2224 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2225 let buf = RunVimInTerminal('-S Xtest', #{rows: 10}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2226 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2227 call term_sendkeys(buf, ":sign \<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2228 call VerifyScreenDump(buf, 'Test_wildmenu_pum_01', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2229 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2230 " going down the popup menu using <Down> |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2231 call term_sendkeys(buf, "\<Down>\<Down>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2232 call VerifyScreenDump(buf, 'Test_wildmenu_pum_02', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2233 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2234 " going down the popup menu using <C-N> |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2235 call term_sendkeys(buf, "\<C-N>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2236 call VerifyScreenDump(buf, 'Test_wildmenu_pum_03', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2237 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2238 " going up the popup menu using <C-P> |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2239 call term_sendkeys(buf, "\<C-P>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2240 call VerifyScreenDump(buf, 'Test_wildmenu_pum_04', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2241 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2242 " going up the popup menu using <Up> |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2243 call term_sendkeys(buf, "\<Up>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2244 call VerifyScreenDump(buf, 'Test_wildmenu_pum_05', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2245 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2246 " pressing <C-E> should end completion and go back to the original match |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2247 call term_sendkeys(buf, "\<C-E>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2248 call VerifyScreenDump(buf, 'Test_wildmenu_pum_06', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2249 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2250 " pressing <C-Y> should select the current match and end completion |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2251 call term_sendkeys(buf, "\<Tab>\<C-P>\<C-P>\<C-Y>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2252 call VerifyScreenDump(buf, 'Test_wildmenu_pum_07', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2253 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2254 " With 'wildmode' set to 'longest,full', completing a match should display |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2255 " the longest match, the wildmenu should not be displayed. |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2256 call term_sendkeys(buf, ":\<C-U>set wildmode=longest,full\<CR>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2257 call TermWait(buf) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2258 call term_sendkeys(buf, ":sign u\<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2259 call VerifyScreenDump(buf, 'Test_wildmenu_pum_08', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2260 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2261 " pressing <Tab> should display the wildmenu |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2262 call term_sendkeys(buf, "\<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2263 call VerifyScreenDump(buf, 'Test_wildmenu_pum_09', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2264 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2265 " pressing <Tab> second time should select the next entry in the menu |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2266 call term_sendkeys(buf, "\<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2267 call VerifyScreenDump(buf, 'Test_wildmenu_pum_10', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2268 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2269 call term_sendkeys(buf, ":\<C-U>set wildmode=full\<CR>") |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2270 " showing popup menu in different columns in the cmdline |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2271 call term_sendkeys(buf, ":sign define \<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2272 call VerifyScreenDump(buf, 'Test_wildmenu_pum_11', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2273 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2274 call term_sendkeys(buf, " \<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2275 call VerifyScreenDump(buf, 'Test_wildmenu_pum_12', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2276 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2277 call term_sendkeys(buf, " \<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2278 call VerifyScreenDump(buf, 'Test_wildmenu_pum_13', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2279 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2280 " Directory name completion |
30255
5928627f00e5
patch 9.0.0463: command line test leaves directory behind
Bram Moolenaar <Bram@vim.org>
parents:
30164
diff
changeset
|
2281 call mkdir('Xnamedir/XdirA/XdirB', 'pR') |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2282 call writefile([], 'Xnamedir/XfileA') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2283 call writefile([], 'Xnamedir/XdirA/XfileB') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2284 call writefile([], 'Xnamedir/XdirA/XdirB/XfileC') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2285 |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2286 call term_sendkeys(buf, "\<C-U>e Xnamedi\<Tab>\<Tab>") |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2287 call VerifyScreenDump(buf, 'Test_wildmenu_pum_14', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2288 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2289 " Pressing <Right> on a directory name should go into that directory |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2290 call term_sendkeys(buf, "\<Right>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2291 call VerifyScreenDump(buf, 'Test_wildmenu_pum_15', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2292 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2293 " Pressing <Left> on a directory name should go to the parent directory |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2294 call term_sendkeys(buf, "\<Left>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2295 call VerifyScreenDump(buf, 'Test_wildmenu_pum_16', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2296 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2297 " Pressing <C-A> when the popup menu is displayed should list all the |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2298 " matches but the popup menu should still remain |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2299 call term_sendkeys(buf, "\<C-U>sign \<Tab>\<C-A>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2300 call VerifyScreenDump(buf, 'Test_wildmenu_pum_17', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2301 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2302 " Pressing <C-D> when the popup menu is displayed should remove the popup |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2303 " menu |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2304 call term_sendkeys(buf, "\<C-U>sign \<Tab>\<C-D>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2305 call VerifyScreenDump(buf, 'Test_wildmenu_pum_18', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2306 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2307 " Pressing <S-Tab> should open the popup menu with the last entry selected |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2308 call term_sendkeys(buf, "\<C-U>\<CR>:sign \<S-Tab>\<C-P>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2309 call VerifyScreenDump(buf, 'Test_wildmenu_pum_19', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2310 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2311 " Pressing <Esc> should close the popup menu and cancel the cmd line |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2312 call term_sendkeys(buf, "\<C-U>\<CR>:sign \<Tab>\<Esc>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2313 call VerifyScreenDump(buf, 'Test_wildmenu_pum_20', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2314 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2315 " Typing a character when the popup is open, should close the popup |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2316 call term_sendkeys(buf, ":sign \<Tab>x") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2317 call VerifyScreenDump(buf, 'Test_wildmenu_pum_21', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2318 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2319 " When the popup is open, entering the cmdline window should close the popup |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2320 call term_sendkeys(buf, "\<C-U>sign \<Tab>\<C-F>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2321 call VerifyScreenDump(buf, 'Test_wildmenu_pum_22', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2322 call term_sendkeys(buf, ":q\<CR>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2323 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2324 " After the last popup menu item, <C-N> should show the original string |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2325 call term_sendkeys(buf, ":sign u\<Tab>\<C-N>\<C-N>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2326 call VerifyScreenDump(buf, 'Test_wildmenu_pum_23', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2327 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2328 " Use the popup menu for the command name |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2329 call term_sendkeys(buf, "\<C-U>bu\<Tab>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2330 call VerifyScreenDump(buf, 'Test_wildmenu_pum_24', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2331 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2332 " Pressing the left arrow should remove the popup menu |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2333 call term_sendkeys(buf, "\<Left>\<Left>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2334 call VerifyScreenDump(buf, 'Test_wildmenu_pum_25', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2335 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2336 " Pressing <BS> should remove the popup menu and erase the last character |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2337 call term_sendkeys(buf, "\<C-E>\<C-U>sign \<Tab>\<BS>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2338 call VerifyScreenDump(buf, 'Test_wildmenu_pum_26', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2339 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2340 " Pressing <C-W> should remove the popup menu and erase the previous word |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2341 call term_sendkeys(buf, "\<C-E>\<C-U>sign \<Tab>\<C-W>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2342 call VerifyScreenDump(buf, 'Test_wildmenu_pum_27', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2343 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2344 " Pressing <C-U> should remove the popup menu and erase the entire line |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2345 call term_sendkeys(buf, "\<C-E>\<C-U>sign \<Tab>\<C-U>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2346 call VerifyScreenDump(buf, 'Test_wildmenu_pum_28', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2347 |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2348 " Using <C-E> to cancel the popup menu and then pressing <Up> should recall |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2349 " the cmdline from history |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2350 call term_sendkeys(buf, "sign xyz\<Esc>:sign \<Tab>\<C-E>\<Up>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2351 call VerifyScreenDump(buf, 'Test_wildmenu_pum_29', {}) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2352 |
27603
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2353 " Check "list" still works |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2354 call term_sendkeys(buf, "\<C-U>set wildmode=longest,list\<CR>") |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2355 call term_sendkeys(buf, ":cn\<Tab>") |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2356 call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {}) |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2357 call term_sendkeys(buf, "s") |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2358 call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {}) |
98139cef237a
patch 8.2.4328: command line complete matches cleard when typing character
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
2359 |
27615
a74901e95937
patch 8.2.4334: command line popup menu not positioned correctly
Bram Moolenaar <Bram@vim.org>
parents:
27603
diff
changeset
|
2360 " Tests a directory name contained full-width characters. |
30255
5928627f00e5
patch 9.0.0463: command line test leaves directory behind
Bram Moolenaar <Bram@vim.org>
parents:
30164
diff
changeset
|
2361 call mkdir('Xnamedir/あいう', 'p') |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2362 call writefile([], 'Xnamedir/あいう/abc') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2363 call writefile([], 'Xnamedir/あいう/xyz') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2364 call writefile([], 'Xnamedir/あいう/123') |
27615
a74901e95937
patch 8.2.4334: command line popup menu not positioned correctly
Bram Moolenaar <Bram@vim.org>
parents:
27603
diff
changeset
|
2365 |
a74901e95937
patch 8.2.4334: command line popup menu not positioned correctly
Bram Moolenaar <Bram@vim.org>
parents:
27603
diff
changeset
|
2366 call term_sendkeys(buf, "\<C-U>set wildmode&\<CR>") |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2367 call term_sendkeys(buf, ":\<C-U>e Xnamedir/あいう/\<Tab>") |
27615
a74901e95937
patch 8.2.4334: command line popup menu not positioned correctly
Bram Moolenaar <Bram@vim.org>
parents:
27603
diff
changeset
|
2368 call VerifyScreenDump(buf, 'Test_wildmenu_pum_32', {}) |
a74901e95937
patch 8.2.4334: command line popup menu not positioned correctly
Bram Moolenaar <Bram@vim.org>
parents:
27603
diff
changeset
|
2369 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2370 " Pressing <C-A> when the popup menu is displayed should list all the |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2371 " matches and pressing a key after that should remove the popup menu |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2372 call term_sendkeys(buf, "\<C-U>set wildmode=full\<CR>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2373 call term_sendkeys(buf, ":sign \<Tab>\<C-A>x") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2374 call VerifyScreenDump(buf, 'Test_wildmenu_pum_33', {}) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2375 |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2376 " Pressing <C-A> when the popup menu is displayed should list all the |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2377 " matches and pressing <Left> after that should move the cursor |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2378 call term_sendkeys(buf, "\<C-U>abc\<Esc>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2379 call term_sendkeys(buf, ":sign \<Tab>\<C-A>\<Left>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2380 call VerifyScreenDump(buf, 'Test_wildmenu_pum_34', {}) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2381 |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2382 " When <C-A> displays a lot of matches (screen scrolls), all the matches |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2383 " should be displayed correctly on the screen. |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2384 call term_sendkeys(buf, "\<End>\<C-U>Tcmd \<Tab>\<C-A>\<Left>\<Left>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2385 call VerifyScreenDump(buf, 'Test_wildmenu_pum_35', {}) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2386 |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2387 " After using <C-A> to expand all the filename matches, pressing <Up> |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2388 " should not open the popup menu again. |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29970
diff
changeset
|
2389 call term_sendkeys(buf, "\<C-E>\<C-U>:cd Xnamedir/XdirA\<CR>") |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2390 call term_sendkeys(buf, ":e \<Tab>\<C-A>\<Up>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2391 call VerifyScreenDump(buf, 'Test_wildmenu_pum_36', {}) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2392 call term_sendkeys(buf, "\<C-E>\<C-U>:cd -\<CR>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2393 |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2394 " After using <C-A> to expand all the matches, pressing <S-Tab> used to |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2395 " crash Vim |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2396 call term_sendkeys(buf, ":sign \<Tab>\<C-A>\<S-Tab>") |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2397 call VerifyScreenDump(buf, 'Test_wildmenu_pum_37', {}) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2398 |
27630
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2399 " After removing the pum the command line is redrawn |
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2400 call term_sendkeys(buf, ":edit foo\<CR>") |
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2401 call term_sendkeys(buf, ":edit bar\<CR>") |
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2402 call term_sendkeys(buf, ":ls\<CR>") |
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2403 call term_sendkeys(buf, ":com\<Tab> ") |
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2404 call VerifyScreenDump(buf, 'Test_wildmenu_pum_38', {}) |
27641
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2405 call term_sendkeys(buf, "\<C-U>\<CR>") |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2406 |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2407 " Esc still works to abort the command when 'statusline' is set |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2408 call term_sendkeys(buf, ":call SetupStatusline()\<CR>") |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2409 call term_sendkeys(buf, ":si\<Tab>") |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2410 call term_sendkeys(buf, "\<Esc>") |
1bdb36828dcc
patch 8.2.4346: a custom statusline may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27630
diff
changeset
|
2411 call VerifyScreenDump(buf, 'Test_wildmenu_pum_39', {}) |
27630
9caeb7f8b094
patch 8.2.4341: command line not redrawn when finishing popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
2412 |
27712
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2413 " Esc still works to abort the command when 'tabline' is set |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2414 call term_sendkeys(buf, ":call SetupTabline()\<CR>") |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2415 call term_sendkeys(buf, ":si\<Tab>") |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2416 call term_sendkeys(buf, "\<Esc>") |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2417 call VerifyScreenDump(buf, 'Test_wildmenu_pum_40', {}) |
9c96612730a0
patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Bram Moolenaar <Bram@vim.org>
parents:
27700
diff
changeset
|
2418 |
27912
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2419 " popup is cleared also when 'lazyredraw' is set |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2420 call term_sendkeys(buf, ":set showtabline=1 laststatus=1 lazyredraw\<CR>") |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2421 call term_sendkeys(buf, ":call DoFeedKeys()\<CR>") |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2422 call VerifyScreenDump(buf, 'Test_wildmenu_pum_41', {}) |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2423 call term_sendkeys(buf, "\<Esc>") |
be9e6e0b1591
patch 8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Bram Moolenaar <Bram@vim.org>
parents:
27908
diff
changeset
|
2424 |
28109
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2425 " Pressing <PageDown> should scroll the menu downward |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2426 call term_sendkeys(buf, ":sign \<Tab>\<PageDown>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2427 call VerifyScreenDump(buf, 'Test_wildmenu_pum_42', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2428 call term_sendkeys(buf, "\<PageDown>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2429 call VerifyScreenDump(buf, 'Test_wildmenu_pum_43', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2430 call term_sendkeys(buf, "\<PageDown>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2431 call VerifyScreenDump(buf, 'Test_wildmenu_pum_44', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2432 call term_sendkeys(buf, "\<PageDown>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2433 call VerifyScreenDump(buf, 'Test_wildmenu_pum_45', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2434 call term_sendkeys(buf, "\<C-U>sign \<Tab>\<Down>\<Down>\<PageDown>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2435 call VerifyScreenDump(buf, 'Test_wildmenu_pum_46', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2436 |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2437 " Pressing <PageUp> should scroll the menu upward |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2438 call term_sendkeys(buf, "\<C-U>sign \<Tab>\<PageUp>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2439 call VerifyScreenDump(buf, 'Test_wildmenu_pum_47', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2440 call term_sendkeys(buf, "\<PageUp>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2441 call VerifyScreenDump(buf, 'Test_wildmenu_pum_48', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2442 call term_sendkeys(buf, "\<PageUp>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2443 call VerifyScreenDump(buf, 'Test_wildmenu_pum_49', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2444 call term_sendkeys(buf, "\<PageUp>") |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2445 call VerifyScreenDump(buf, 'Test_wildmenu_pum_50', {}) |
06535d568f74
patch 8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
28107
diff
changeset
|
2446 |
27597
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2447 call term_sendkeys(buf, "\<C-U>\<CR>") |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2448 call StopVimInTerminal(buf) |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2449 endfunc |
4eb2bf8b2f27
patch 8.2.4325: 'wildmenu' only shows few matches
Bram Moolenaar <Bram@vim.org>
parents:
26213
diff
changeset
|
2450 |
27626
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2451 " Test for wildmenumode() with the cmdline popup menu |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2452 func Test_wildmenumode_with_pum() |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2453 set wildmenu |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2454 set wildoptions=pum |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2455 cnoremap <expr> <F2> wildmenumode() |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2456 call feedkeys(":sign \<Tab>\<F2>\<F2>\<C-B>\"\<CR>", 'xt') |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2457 call assert_equal('"sign define10', @:) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2458 call feedkeys(":sign \<Tab>\<C-A>\<F2>\<C-B>\"\<CR>", 'xt') |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2459 call assert_equal('"sign define jump list place undefine unplace0', @:) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2460 call feedkeys(":sign \<Tab>\<C-E>\<F2>\<C-B>\"\<CR>", 'xt') |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2461 call assert_equal('"sign 0', @:) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2462 call feedkeys(":sign \<Tab>\<C-Y>\<F2>\<C-B>\"\<CR>", 'xt') |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2463 call assert_equal('"sign define0', @:) |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2464 set nowildmenu wildoptions& |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2465 cunmap <F2> |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2466 endfunc |
95d6e3c9aa1e
patch 8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
27615
diff
changeset
|
2467 |
28427
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2468 func Test_wildmenu_with_pum_foldexpr() |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2469 CheckRunVimInTerminal |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2470 |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2471 let lines =<< trim END |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2472 call setline(1, ['folded one', 'folded two', 'some more text']) |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2473 func MyFoldText() |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2474 return 'foo' |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2475 endfunc |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2476 set foldtext=MyFoldText() wildoptions=pum |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2477 normal ggzfj |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2478 END |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2479 call writefile(lines, 'Xpumfold', 'D') |
28427
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2480 let buf = RunVimInTerminal('-S Xpumfold', #{rows: 10}) |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2481 call term_sendkeys(buf, ":set\<Tab>") |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2482 call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_1', {}) |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2483 |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2484 call term_sendkeys(buf, "\<Esc>") |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2485 call VerifyScreenDump(buf, 'Test_wildmenu_with_pum_foldexpr_2', {}) |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2486 |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2487 call StopVimInTerminal(buf) |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2488 endfunc |
96d53065f309
patch 8.2.4738: Esc on commandline executes command instead of abandoning it
Bram Moolenaar <Bram@vim.org>
parents:
28317
diff
changeset
|
2489 |
28259
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2490 " Test for opening the cmdline completion popup menu from the terminal window. |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2491 " The popup menu should be positioned correctly over the status line of the |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2492 " bottom-most window. |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2493 func Test_wildmenu_pum_from_terminal() |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2494 CheckRunVimInTerminal |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2495 let python = PythonProg() |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2496 call CheckPython(python) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2497 |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2498 %bw! |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2499 let cmds = ['set wildmenu wildoptions=pum'] |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2500 let pcmd = python .. ' -c "import sys; sys.stdout.write(sys.stdin.read())"' |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2501 call add(cmds, "call term_start('" .. pcmd .. "')") |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2502 call writefile(cmds, 'Xtest', 'D') |
28259
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2503 let buf = RunVimInTerminal('-S Xtest', #{rows: 10}) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2504 call term_sendkeys(buf, "\r\r\r") |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2505 call term_wait(buf) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2506 call term_sendkeys(buf, "\<C-W>:sign \<Tab>") |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2507 call term_wait(buf) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2508 call VerifyScreenDump(buf, 'Test_wildmenu_pum_term_01', {}) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2509 call term_wait(buf) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2510 call StopVimInTerminal(buf) |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2511 endfunc |
0f1a0bef2c02
patch 8.2.4655: cmdline completion popup menu positioned wrong
Bram Moolenaar <Bram@vim.org>
parents:
28205
diff
changeset
|
2512 |
31394
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2513 func Test_wildmenu_pum_clear_entries() |
31398
a5561303189e
patch 9.0.1032: test fails when terminal feature is missing
Bram Moolenaar <Bram@vim.org>
parents:
31394
diff
changeset
|
2514 CheckRunVimInTerminal |
a5561303189e
patch 9.0.1032: test fails when terminal feature is missing
Bram Moolenaar <Bram@vim.org>
parents:
31394
diff
changeset
|
2515 |
31394
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2516 " This was using freed memory. Run in a terminal to get the pum to update. |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2517 let lines =<< trim END |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2518 set wildoptions=pum |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2519 set wildchar=<C-E> |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2520 END |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2521 call writefile(lines, 'XwildmenuTest', 'D') |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2522 let buf = RunVimInTerminal('-S XwildmenuTest', #{rows: 10}) |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2523 |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2524 call term_sendkeys(buf, ":\<C-E>\<C-E>") |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2525 call VerifyScreenDump(buf, 'Test_wildmenu_pum_clear_entries_1', {}) |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2526 |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2527 set wildoptions& wildchar& |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2528 endfunc |
a6b1f1c22374
patch 9.0.1030: using freed memory with the cmdline popup menu
Bram Moolenaar <Bram@vim.org>
parents:
31020
diff
changeset
|
2529 |
27722
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2530 " Test for completion after a :substitute command followed by a pipe (|) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2531 " character |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2532 func Test_cmdline_complete_substitute() |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2533 call feedkeys(":s | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2534 call assert_equal("\"s | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2535 call feedkeys(":s/ | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2536 call assert_equal("\"s/ | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2537 call feedkeys(":s/one | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2538 call assert_equal("\"s/one | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2539 call feedkeys(":s/one/ | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2540 call assert_equal("\"s/one/ | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2541 call feedkeys(":s/one/two | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2542 call assert_equal("\"s/one/two | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2543 call feedkeys(":s/one/two/ | chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2544 call assert_equal('"s/one/two/ | chistory', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2545 call feedkeys(":s/one/two/g \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2546 call assert_equal("\"s/one/two/g \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2547 call feedkeys(":s/one/two/g | chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2548 call assert_equal("\"s/one/two/g | chistory", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2549 call feedkeys(":s/one/t\\/ | \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2550 call assert_equal("\"s/one/t\\/ | \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2551 call feedkeys(":s/one/t\"o/ | chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2552 call assert_equal('"s/one/t"o/ | chistory', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2553 call feedkeys(":s/one/t|o/ | chist\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2554 call assert_equal('"s/one/t|o/ | chistory', @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2555 call feedkeys(":&\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2556 call assert_equal("\"&\t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2557 endfunc |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2558 |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2559 " Test for the :dlist command completion |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2560 func Test_cmdline_complete_dlist() |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2561 call feedkeys(":dlist 10 /pat/ a\<C-A>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2562 call assert_equal("\"dlist 10 /pat/ a\<C-A>", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2563 call feedkeys(":dlist 10 /pat/ \t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2564 call assert_equal("\"dlist 10 /pat/ \t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2565 call feedkeys(":dlist 10 /pa\\t/\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2566 call assert_equal("\"dlist 10 /pa\\t/\t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2567 call feedkeys(":dlist 10 /pat\\\t\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2568 call assert_equal("\"dlist 10 /pat\\\t", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2569 call feedkeys(":dlist 10 /pat/ | chist\<Tab>\<C-B>\"\<CR>", 'xt') |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2570 call assert_equal("\"dlist 10 /pat/ | chistory", @:) |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2571 endfunc |
637ccebaf328
patch 8.2.4387: command line completion doesn't always work properly
Bram Moolenaar <Bram@vim.org>
parents:
27712
diff
changeset
|
2572 |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2573 " argument list (only for :argdel) fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2574 func Test_fuzzy_completion_arglist() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2575 argadd change.py count.py charge.py |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2576 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2577 call feedkeys(":argdel cge\<C-A>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2578 call assert_equal('"argdel cge', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2579 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2580 call feedkeys(":argdel cge\<C-A>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2581 call assert_equal('"argdel change.py charge.py', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2582 %argdelete |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2583 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2584 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2585 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2586 " autocmd group name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2587 func Test_fuzzy_completion_autocmd() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2588 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2589 augroup MyFuzzyGroup |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2590 augroup END |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2591 call feedkeys(":augroup mfg\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2592 call assert_equal('"augroup mfg', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2593 call feedkeys(":augroup My*p\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2594 call assert_equal('"augroup MyFuzzyGroup', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2595 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2596 call feedkeys(":augroup mfg\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2597 call assert_equal('"augroup MyFuzzyGroup', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2598 call feedkeys(":augroup My*p\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2599 call assert_equal('"augroup My*p', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2600 augroup! MyFuzzyGroup |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2601 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2602 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2603 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2604 " buffer name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2605 func Test_fuzzy_completion_bufname() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2606 set wildoptions& |
29617
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2607 " Use a long name to reduce the risk of matching a random directory name |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2608 edit SomeRandomFileWithLetters.txt |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2609 enew |
29617
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2610 call feedkeys(":b SRFWL\<Tab>\<C-B>\"\<CR>", 'tx') |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2611 call assert_equal('"b SRFWL', @:) |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2612 call feedkeys(":b S*FileWithLetters.txt\<Tab>\<C-B>\"\<CR>", 'tx') |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2613 call assert_equal('"b SomeRandomFileWithLetters.txt', @:) |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2614 set wildoptions=fuzzy |
29617
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2615 call feedkeys(":b SRFWL\<Tab>\<C-B>\"\<CR>", 'tx') |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2616 call assert_equal('"b SomeRandomFileWithLetters.txt', @:) |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2617 call feedkeys(":b S*FileWithLetters.txt\<Tab>\<C-B>\"\<CR>", 'tx') |
ee5acbac6abe
patch 9.0.0149: test for fuzzy completion fails sometimes
Bram Moolenaar <Bram@vim.org>
parents:
29495
diff
changeset
|
2618 call assert_equal('"b S*FileWithLetters.txt', @:) |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2619 %bw! |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2620 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2621 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2622 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2623 " buffer name (full path) fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2624 func Test_fuzzy_completion_bufname_fullpath() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2625 CheckUnix |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2626 set wildoptions& |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
2627 call mkdir('Xcmd/Xstate/Xfile.js', 'pR') |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2628 edit Xcmd/Xstate/Xfile.js |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2629 cd Xcmd/Xstate |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2630 enew |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2631 call feedkeys(":b CmdStateFile\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2632 call assert_equal('"b CmdStateFile', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2633 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2634 call feedkeys(":b CmdStateFile\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2635 call assert_match('Xcmd/Xstate/Xfile.js$', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2636 cd - |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2637 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2638 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2639 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2640 " :behave suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2641 func Test_fuzzy_completion_behave() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2642 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2643 call feedkeys(":behave xm\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2644 call assert_equal('"behave xm', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2645 call feedkeys(":behave xt*m\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2646 call assert_equal('"behave xterm', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2647 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2648 call feedkeys(":behave xm\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2649 call assert_equal('"behave xterm', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2650 call feedkeys(":behave xt*m\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2651 call assert_equal('"behave xt*m', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2652 let g:Sline = '' |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2653 call feedkeys(":behave win\<C-D>\<F4>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2654 call assert_equal('mswin', g:Sline) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2655 call assert_equal('"behave win', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2656 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2657 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2658 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2659 " " colorscheme name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2660 " func Test_fuzzy_completion_colorscheme() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2661 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2662 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2663 " built-in command name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2664 func Test_fuzzy_completion_cmdname() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2665 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2666 call feedkeys(":sbwin\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2667 call assert_equal('"sbwin', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2668 call feedkeys(":sbr*d\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2669 call assert_equal('"sbrewind', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2670 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2671 call feedkeys(":sbwin\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2672 call assert_equal('"sbrewind', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2673 call feedkeys(":sbr*d\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2674 call assert_equal('"sbr*d', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2675 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2676 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2677 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2678 " " compiler name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2679 " func Test_fuzzy_completion_compiler() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2680 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2681 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2682 " :cscope suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2683 func Test_fuzzy_completion_cscope() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2684 CheckFeature cscope |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2685 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2686 call feedkeys(":cscope ret\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2687 call assert_equal('"cscope ret', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2688 call feedkeys(":cscope re*t\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2689 call assert_equal('"cscope reset', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2690 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2691 call feedkeys(":cscope ret\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2692 call assert_equal('"cscope reset', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2693 call feedkeys(":cscope re*t\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2694 call assert_equal('"cscope re*t', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2695 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2696 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2697 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2698 " :diffget/:diffput buffer name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2699 func Test_fuzzy_completion_diff() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2700 new SomeBuffer |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2701 diffthis |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2702 new OtherBuffer |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2703 diffthis |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2704 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2705 call feedkeys(":diffget sbuf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2706 call assert_equal('"diffget sbuf', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2707 call feedkeys(":diffput sbuf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2708 call assert_equal('"diffput sbuf', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2709 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2710 call feedkeys(":diffget sbuf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2711 call assert_equal('"diffget SomeBuffer', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2712 call feedkeys(":diffput sbuf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2713 call assert_equal('"diffput SomeBuffer', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2714 %bw! |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2715 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2716 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2717 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2718 " " directory name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2719 " func Test_fuzzy_completion_dirname() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2720 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2721 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2722 " environment variable name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2723 func Test_fuzzy_completion_env() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2724 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2725 call feedkeys(":echo $VUT\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2726 call assert_equal('"echo $VUT', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2727 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2728 call feedkeys(":echo $VUT\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2729 call assert_equal('"echo $VIMRUNTIME', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2730 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2731 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2732 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2733 " autocmd event fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2734 func Test_fuzzy_completion_autocmd_event() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2735 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2736 call feedkeys(":autocmd BWout\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2737 call assert_equal('"autocmd BWout', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2738 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2739 call feedkeys(":autocmd BWout\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2740 call assert_equal('"autocmd BufWipeout', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2741 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2742 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2743 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2744 " vim expression fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2745 func Test_fuzzy_completion_expr() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2746 let g:PerPlaceCount = 10 |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2747 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2748 call feedkeys(":let c = ppc\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2749 call assert_equal('"let c = ppc', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2750 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2751 call feedkeys(":let c = ppc\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2752 call assert_equal('"let c = PerPlaceCount', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2753 set wildoptions& |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2754 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2755 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2756 " " file name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2757 " func Test_fuzzy_completion_filename() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2758 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2759 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2760 " " files in path fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2761 " func Test_fuzzy_completion_filesinpath() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2762 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2763 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2764 " " filetype name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2765 " func Test_fuzzy_completion_filetype() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2766 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2767 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2768 " user defined function name completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2769 func Test_fuzzy_completion_userdefined_func() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2770 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2771 call feedkeys(":call Test_f_u_f\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2772 call assert_equal('"call Test_f_u_f', @:) |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2773 set wildoptions=fuzzy |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2774 call feedkeys(":call Test_f_u_f\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2775 call assert_equal('"call Test_fuzzy_completion_userdefined_func()', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2776 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2777 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2778 |
27916
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2779 " <SNR> functions should be sorted to the end |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2780 func Test_fuzzy_completion_userdefined_snr_func() |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2781 func s:Sendmail() |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2782 endfunc |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2783 func SendSomemail() |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2784 endfunc |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2785 func S1e2n3dmail() |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2786 endfunc |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2787 set wildoptions=fuzzy |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2788 call feedkeys(":call sendmail\<C-A>\<C-B>\"\<CR>", 'tx') |
28107
710a509be2cd
patch 8.2.4578: no warning when autoload script for completion has an error
Bram Moolenaar <Bram@vim.org>
parents:
28091
diff
changeset
|
2789 call assert_match('"call SendSomemail() S1e2n3dmail() <SNR>\d\+_Sendmail()', @:) |
27916
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2790 set wildoptions& |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2791 delfunc s:Sendmail |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2792 delfunc SendSomemail |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2793 delfunc S1e2n3dmail |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2794 endfunc |
6efa2f193c94
patch 8.2.4483: command completion makes two rounds to collect matches
Bram Moolenaar <Bram@vim.org>
parents:
27914
diff
changeset
|
2795 |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2796 " user defined command name completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2797 func Test_fuzzy_completion_userdefined_cmd() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2798 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2799 call feedkeys(":MsFeat\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2800 call assert_equal('"MsFeat', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2801 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2802 call feedkeys(":MsFeat\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2803 call assert_equal('"MissingFeature', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2804 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2805 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2806 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2807 " " :help tag fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2808 " func Test_fuzzy_completion_helptag() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2809 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2810 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2811 " highlight group name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2812 func Test_fuzzy_completion_hlgroup() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2813 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2814 call feedkeys(":highlight SKey\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2815 call assert_equal('"highlight SKey', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2816 call feedkeys(":highlight Sp*Key\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2817 call assert_equal('"highlight SpecialKey', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2818 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2819 call feedkeys(":highlight SKey\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2820 call assert_equal('"highlight SpecialKey', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2821 call feedkeys(":highlight Sp*Key\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2822 call assert_equal('"highlight Sp*Key', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2823 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2824 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2825 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2826 " :history suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2827 func Test_fuzzy_completion_history() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2828 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2829 call feedkeys(":history dg\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2830 call assert_equal('"history dg', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2831 call feedkeys(":history se*h\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2832 call assert_equal('"history search', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2833 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2834 call feedkeys(":history dg\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2835 call assert_equal('"history debug', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2836 call feedkeys(":history se*h\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2837 call assert_equal('"history se*h', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2838 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2839 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2840 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2841 " :language locale name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2842 func Test_fuzzy_completion_lang() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2843 CheckUnix |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2844 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2845 call feedkeys(":lang psx\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2846 call assert_equal('"lang psx', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2847 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2848 call feedkeys(":lang psx\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2849 call assert_equal('"lang POSIX', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2850 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2851 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2852 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2853 " :mapclear buffer argument fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2854 func Test_fuzzy_completion_mapclear() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2855 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2856 call feedkeys(":mapclear buf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2857 call assert_equal('"mapclear buf', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2858 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2859 call feedkeys(":mapclear buf\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2860 call assert_equal('"mapclear <buffer>', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2861 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2862 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2863 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2864 " map name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2865 func Test_fuzzy_completion_mapname() |
27906
11141b2ec0e1
patch 8.2.4478: crash when using fuzzy completion
Bram Moolenaar <Bram@vim.org>
parents:
27899
diff
changeset
|
2866 " test regex completion works |
11141b2ec0e1
patch 8.2.4478: crash when using fuzzy completion
Bram Moolenaar <Bram@vim.org>
parents:
27899
diff
changeset
|
2867 set wildoptions=fuzzy |
11141b2ec0e1
patch 8.2.4478: crash when using fuzzy completion
Bram Moolenaar <Bram@vim.org>
parents:
27899
diff
changeset
|
2868 call feedkeys(":cnoremap <ex\<Tab> <esc> \<Tab>\<C-B>\"\<CR>", 'tx') |
11141b2ec0e1
patch 8.2.4478: crash when using fuzzy completion
Bram Moolenaar <Bram@vim.org>
parents:
27899
diff
changeset
|
2869 call assert_equal("\"cnoremap <expr> <esc> \<Tab>", @:) |
27908
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2870 nmap <plug>MyLongMap :p<CR> |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2871 call feedkeys(":nmap MLM\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2872 call assert_equal("\"nmap <Plug>MyLongMap", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2873 call feedkeys(":nmap MLM \<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2874 call assert_equal("\"nmap MLM \t", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2875 call feedkeys(":nmap <F2> one two \<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2876 call assert_equal("\"nmap <F2> one two \t", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2877 " duplicate entries should be removed |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2878 vmap <plug>MyLongMap :<C-U>#<CR> |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2879 call feedkeys(":nmap MLM\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2880 call assert_equal("\"nmap <Plug>MyLongMap", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2881 nunmap <plug>MyLongMap |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2882 vunmap <plug>MyLongMap |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2883 call feedkeys(":nmap ABC\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2884 call assert_equal("\"nmap ABC\t", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2885 " results should be sorted by best match |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2886 nmap <Plug>format : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2887 nmap <Plug>goformat : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2888 nmap <Plug>TestFOrmat : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2889 nmap <Plug>fendoff : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2890 nmap <Plug>state : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2891 nmap <Plug>FendingOff : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2892 call feedkeys(":nmap <Plug>fo\<C-A>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2893 call assert_equal("\"nmap <Plug>format <Plug>TestFOrmat <Plug>FendingOff <Plug>goformat <Plug>fendoff", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2894 nunmap <Plug>format |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2895 nunmap <Plug>goformat |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2896 nunmap <Plug>TestFOrmat |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2897 nunmap <Plug>fendoff |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2898 nunmap <Plug>state |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2899 nunmap <Plug>FendingOff |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2900 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2901 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2902 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2903 " abbreviation fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2904 func Test_fuzzy_completion_abbr() |
27908
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2905 set wildoptions=fuzzy |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2906 call feedkeys(":iabbr wait\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2907 call assert_equal("\"iabbr <nowait>", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2908 iabbr WaitForCompletion WFC |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2909 call feedkeys(":iabbr fcl\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2910 call assert_equal("\"iabbr WaitForCompletion", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2911 call feedkeys(":iabbr a1z\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2912 call assert_equal("\"iabbr a1z\t", @:) |
31792
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2913 |
27908
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
2914 iunabbrev WaitForCompletion |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2915 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2916 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2917 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2918 " menu name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2919 func Test_fuzzy_completion_menu() |
31792
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2920 CheckFeature menu |
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2921 |
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2922 source $VIMRUNTIME/menu.vim |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2923 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2924 call feedkeys(":menu pup\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2925 call assert_equal('"menu pup', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2926 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2927 call feedkeys(":menu pup\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2928 call assert_equal('"menu PopUp.', @:) |
31792
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2929 |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2930 set wildoptions& |
31792
5369ce341633
patch 9.0.1228: fuzzy menu completion is only tested in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
31790
diff
changeset
|
2931 source $VIMRUNTIME/delmenu.vim |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2932 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2933 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2934 " :messages suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2935 func Test_fuzzy_completion_messages() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2936 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2937 call feedkeys(":messages clr\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2938 call assert_equal('"messages clr', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2939 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2940 call feedkeys(":messages clr\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2941 call assert_equal('"messages clear', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2942 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2943 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2944 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2945 " :set option name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2946 func Test_fuzzy_completion_option() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2947 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2948 call feedkeys(":set brkopt\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2949 call assert_equal('"set brkopt', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2950 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2951 call feedkeys(":set brkopt\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2952 call assert_equal('"set breakindentopt', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2953 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2954 call feedkeys(":set fixeol\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2955 call assert_equal('"set fixendofline', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2956 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2957 call feedkeys(":set fixeol\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2958 call assert_equal('"set fixendofline', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2959 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2960 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2961 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2962 " :set <term_option> |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2963 func Test_fuzzy_completion_term_option() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2964 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2965 call feedkeys(":set t_E\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2966 call assert_equal('"set t_EC', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2967 call feedkeys(":set <t_E\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2968 call assert_equal('"set <t_EC>', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2969 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2970 call feedkeys(":set t_E\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2971 call assert_equal('"set t_EC', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2972 call feedkeys(":set <t_E\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2973 call assert_equal('"set <t_EC>', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2974 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2975 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2976 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2977 " " :packadd directory name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2978 " func Test_fuzzy_completion_packadd() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2979 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2980 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2981 " " shell command name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2982 " func Test_fuzzy_completion_shellcmd() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2983 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2984 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2985 " :sign suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2986 func Test_fuzzy_completion_sign() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2987 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2988 call feedkeys(":sign ufe\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2989 call assert_equal('"sign ufe', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2990 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2991 call feedkeys(":sign ufe\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2992 call assert_equal('"sign undefine', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2993 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2994 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2995 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2996 " :syntax suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
2997 func Test_fuzzy_completion_syntax_cmd() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2998 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
2999 call feedkeys(":syntax kwd\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3000 call assert_equal('"syntax kwd', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3001 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3002 call feedkeys(":syntax kwd\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3003 call assert_equal('"syntax keyword', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3004 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3005 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3006 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3007 " syntax group name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3008 func Test_fuzzy_completion_syntax_group() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3009 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3010 call feedkeys(":syntax list mpar\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3011 call assert_equal('"syntax list mpar', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3012 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3013 call feedkeys(":syntax list mpar\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3014 call assert_equal('"syntax list MatchParen', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3015 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3016 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3017 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3018 " :syntime suboptions fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3019 func Test_fuzzy_completion_syntime() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3020 CheckFeature profile |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3021 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3022 call feedkeys(":syntime clr\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3023 call assert_equal('"syntime clr', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3024 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3025 call feedkeys(":syntime clr\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3026 call assert_equal('"syntime clear', @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3027 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3028 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3029 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3030 " " tag name fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3031 " func Test_fuzzy_completion_tagname() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3032 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3033 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3034 " " tag name and file fuzzy completion - NOT supported |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3035 " func Test_fuzzy_completion_tagfile() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3036 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3037 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3038 " " user names fuzzy completion - how to test this functionality? |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3039 " func Test_fuzzy_completion_username() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3040 " endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3041 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3042 " user defined variable name fuzzy completion |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3043 func Test_fuzzy_completion_userdefined_var() |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3044 let g:SomeVariable=10 |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3045 set wildoptions& |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3046 call feedkeys(":let SVar\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3047 call assert_equal('"let SVar', @:) |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3048 set wildoptions=fuzzy |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3049 call feedkeys(":let SVar\<Tab>\<C-B>\"\<CR>", 'tx') |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3050 call assert_equal('"let SomeVariable', @:) |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3051 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3052 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3053 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3054 " Test for sorting the results by the best match |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3055 func Test_fuzzy_completion_cmd_sort_results() |
27879
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3056 %bw! |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3057 command T123format : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3058 command T123goformat : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3059 command T123TestFOrmat : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3060 command T123fendoff : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3061 command T123state : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3062 command T123FendingOff : |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3063 set wildoptions=fuzzy |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3064 call feedkeys(":T123fo\<C-A>\<C-B>\"\<CR>", 'tx') |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3065 call assert_equal('"T123format T123TestFOrmat T123FendingOff T123goformat T123fendoff', @:) |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3066 delcommand T123format |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3067 delcommand T123goformat |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3068 delcommand T123TestFOrmat |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3069 delcommand T123fendoff |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3070 delcommand T123state |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3071 delcommand T123FendingOff |
76e2115dddb8
patch 8.2.4465: fuzzy completion does not order matches properly
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
3072 %bw |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3073 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3074 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3075 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3076 " Test for fuzzy completion of a command with lower case letters and a number |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3077 func Test_fuzzy_completion_cmd_alnum() |
27899
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3078 command Foo2Bar : |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3079 set wildoptions=fuzzy |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3080 call feedkeys(":foo2\<Tab>\<C-B>\"\<CR>", 'tx') |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3081 call assert_equal('"Foo2Bar', @:) |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3082 call feedkeys(":foo\<Tab>\<C-B>\"\<CR>", 'tx') |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3083 call assert_equal('"Foo2Bar', @:) |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3084 call feedkeys(":bar\<Tab>\<C-B>\"\<CR>", 'tx') |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3085 call assert_equal('"Foo2Bar', @:) |
5426a1d3f12d
patch 8.2.4475: fuzzy cmdline completion does not work for lower case
Bram Moolenaar <Bram@vim.org>
parents:
27879
diff
changeset
|
3086 delcommand Foo2Bar |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3087 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3088 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3089 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3090 " Test for command completion for a command starting with 'k' |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3091 func Test_fuzzy_completion_cmd_k() |
27908
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3092 command KillKillKill : |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3093 set wildoptions& |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3094 call feedkeys(":killkill\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3095 call assert_equal("\"killkill\<Tab>", @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3096 set wildoptions=fuzzy |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3097 call feedkeys(":killkill\<Tab>\<C-B>\"\<CR>", 'tx') |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3098 call assert_equal('"KillKillKill', @:) |
099c2e612827
patch 8.2.4479: no fuzzy completieon for maps and abbreviations
Bram Moolenaar <Bram@vim.org>
parents:
27906
diff
changeset
|
3099 delcom KillKillKill |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3100 set wildoptions& |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3101 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3102 |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3103 " Test for fuzzy completion for user defined custom completion function |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3104 func Test_fuzzy_completion_custom_func() |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3105 func Tcompl(a, c, p) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3106 return "format\ngoformat\nTestFOrmat\nfendoff\nstate" |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3107 endfunc |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3108 command -nargs=* -complete=custom,Tcompl Fuzzy : |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3109 set wildoptions& |
27914
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3110 call feedkeys(":Fuzzy fo\<C-A>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3111 call assert_equal("\"Fuzzy format", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3112 call feedkeys(":Fuzzy xy\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3113 call assert_equal("\"Fuzzy xy", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3114 call feedkeys(":Fuzzy ttt\<C-A>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3115 call assert_equal("\"Fuzzy ttt", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3116 set wildoptions=fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3117 call feedkeys(":Fuzzy \<C-A>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3118 call assert_equal("\"Fuzzy format goformat TestFOrmat fendoff state", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3119 call feedkeys(":Fuzzy fo\<C-A>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3120 call assert_equal("\"Fuzzy format TestFOrmat goformat fendoff", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3121 call feedkeys(":Fuzzy xy\<Tab>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3122 call assert_equal("\"Fuzzy xy", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3123 call feedkeys(":Fuzzy ttt\<C-A>\<C-B>\"\<CR>", 'tx') |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3124 call assert_equal("\"Fuzzy TestFOrmat", @:) |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3125 delcom Fuzzy |
9a997de62da2
patch 8.2.4482: no fuzzy cmdline completion for user defined completion
Bram Moolenaar <Bram@vim.org>
parents:
27912
diff
changeset
|
3126 set wildoptions& |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3127 endfunc |
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27744
diff
changeset
|
3128 |
28081
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3129 " Test for :breakadd argument completion |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3130 func Test_cmdline_complete_breakadd() |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3131 call feedkeys(":breakadd \<C-A>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3132 call assert_equal("\"breakadd expr file func here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3133 call feedkeys(":breakadd \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3134 call assert_equal("\"breakadd expr", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3135 call feedkeys(":breakadd \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3136 call assert_equal("\"breakadd expr", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3137 call feedkeys(":breakadd he\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3138 call assert_equal("\"breakadd here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3139 call feedkeys(":breakadd he\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3140 call assert_equal("\"breakadd here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3141 call feedkeys(":breakadd abc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3142 call assert_equal("\"breakadd abc", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3143 call assert_equal(['expr', 'file', 'func', 'here'], getcompletion('', 'breakpoint')) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3144 let l = getcompletion('not', 'breakpoint') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3145 call assert_equal([], l) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3146 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3147 " Test for :breakadd file [lnum] <file> |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
3148 call writefile([], 'Xscript', 'D') |
28081
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3149 call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3150 call assert_equal("\"breakadd file Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3151 call feedkeys(":breakadd file Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3152 call assert_equal("\"breakadd file Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3153 call feedkeys(":breakadd file 20 Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3154 call assert_equal("\"breakadd file 20 Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3155 call feedkeys(":breakadd file 20 Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3156 call assert_equal("\"breakadd file 20 Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3157 call feedkeys(":breakadd file 20x Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3158 call assert_equal("\"breakadd file 20x Xsc\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3159 call feedkeys(":breakadd file 20\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3160 call assert_equal("\"breakadd file 20\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3161 call feedkeys(":breakadd file 20x\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3162 call assert_equal("\"breakadd file 20x\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3163 call feedkeys(":breakadd file Xscript \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3164 call assert_equal("\"breakadd file Xscript ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3165 call feedkeys(":breakadd file X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3166 call assert_equal("\"breakadd file X1B2C3", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3167 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3168 " Test for :breakadd func [lnum] <function> |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3169 func Xbreak_func() |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3170 endfunc |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3171 call feedkeys(":breakadd func Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3172 call assert_equal("\"breakadd func Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3173 call feedkeys(":breakadd func Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3174 call assert_equal("\"breakadd func Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3175 call feedkeys(":breakadd func 20 Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3176 call assert_equal("\"breakadd func 20 Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3177 call feedkeys(":breakadd func 20 Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3178 call assert_equal("\"breakadd func 20 Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3179 call feedkeys(":breakadd func 20x Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3180 call assert_equal("\"breakadd func 20x Xbr\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3181 call feedkeys(":breakadd func 20\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3182 call assert_equal("\"breakadd func 20\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3183 call feedkeys(":breakadd func 20x\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3184 call assert_equal("\"breakadd func 20x\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3185 call feedkeys(":breakadd func Xbreak_func \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3186 call assert_equal("\"breakadd func Xbreak_func ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3187 call feedkeys(":breakadd func X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3188 call assert_equal("\"breakadd func X1B2C3", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3189 delfunc Xbreak_func |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3190 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3191 " Test for :breakadd expr <expression> |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3192 let g:Xtest_var = 10 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3193 call feedkeys(":breakadd expr Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3194 call assert_equal("\"breakadd expr Xtest_var", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3195 call feedkeys(":breakadd expr Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3196 call assert_equal("\"breakadd expr Xtest_var", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3197 call feedkeys(":breakadd expr Xtest_var \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3198 call assert_equal("\"breakadd expr Xtest_var ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3199 call feedkeys(":breakadd expr X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3200 call assert_equal("\"breakadd expr X1B2C3", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3201 unlet g:Xtest_var |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3202 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3203 " Test for :breakadd here |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3204 call feedkeys(":breakadd here Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3205 call assert_equal("\"breakadd here Xtest", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3206 call feedkeys(":breakadd here Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3207 call assert_equal("\"breakadd here Xtest", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3208 call feedkeys(":breakadd here \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3209 call assert_equal("\"breakadd here ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3210 endfunc |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3211 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3212 " Test for :breakdel argument completion |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3213 func Test_cmdline_complete_breakdel() |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3214 call feedkeys(":breakdel \<C-A>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3215 call assert_equal("\"breakdel file func here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3216 call feedkeys(":breakdel \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3217 call assert_equal("\"breakdel file", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3218 call feedkeys(":breakdel \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3219 call assert_equal("\"breakdel file", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3220 call feedkeys(":breakdel he\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3221 call assert_equal("\"breakdel here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3222 call feedkeys(":breakdel he\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3223 call assert_equal("\"breakdel here", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3224 call feedkeys(":breakdel abc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3225 call assert_equal("\"breakdel abc", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3226 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3227 " Test for :breakdel file [lnum] <file> |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
3228 call writefile([], 'Xscript', 'D') |
28081
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3229 call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3230 call assert_equal("\"breakdel file Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3231 call feedkeys(":breakdel file Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3232 call assert_equal("\"breakdel file Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3233 call feedkeys(":breakdel file 20 Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3234 call assert_equal("\"breakdel file 20 Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3235 call feedkeys(":breakdel file 20 Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3236 call assert_equal("\"breakdel file 20 Xscript", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3237 call feedkeys(":breakdel file 20x Xsc\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3238 call assert_equal("\"breakdel file 20x Xsc\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3239 call feedkeys(":breakdel file 20\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3240 call assert_equal("\"breakdel file 20\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3241 call feedkeys(":breakdel file 20x\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3242 call assert_equal("\"breakdel file 20x\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3243 call feedkeys(":breakdel file Xscript \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3244 call assert_equal("\"breakdel file Xscript ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3245 call feedkeys(":breakdel file X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3246 call assert_equal("\"breakdel file X1B2C3", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3247 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3248 " Test for :breakdel func [lnum] <function> |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3249 func Xbreak_func() |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3250 endfunc |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3251 call feedkeys(":breakdel func Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3252 call assert_equal("\"breakdel func Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3253 call feedkeys(":breakdel func Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3254 call assert_equal("\"breakdel func Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3255 call feedkeys(":breakdel func 20 Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3256 call assert_equal("\"breakdel func 20 Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3257 call feedkeys(":breakdel func 20 Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3258 call assert_equal("\"breakdel func 20 Xbreak_func", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3259 call feedkeys(":breakdel func 20x Xbr\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3260 call assert_equal("\"breakdel func 20x Xbr\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3261 call feedkeys(":breakdel func 20\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3262 call assert_equal("\"breakdel func 20\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3263 call feedkeys(":breakdel func 20x\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3264 call assert_equal("\"breakdel func 20x\t", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3265 call feedkeys(":breakdel func Xbreak_func \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3266 call assert_equal("\"breakdel func Xbreak_func ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3267 call feedkeys(":breakdel func X1B2C3\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3268 call assert_equal("\"breakdel func X1B2C3", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3269 delfunc Xbreak_func |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3270 |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3271 " Test for :breakdel here |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3272 call feedkeys(":breakdel here Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3273 call assert_equal("\"breakdel here Xtest", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3274 call feedkeys(":breakdel here Xtest\<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3275 call assert_equal("\"breakdel here Xtest", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3276 call feedkeys(":breakdel here \<Tab>\<C-B>\"\<CR>", 'tx') |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3277 call assert_equal("\"breakdel here ", @:) |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3278 endfunc |
b737bfa876c5
patch 8.2.4565: no command line completion for :breakadd and :breakdel
Bram Moolenaar <Bram@vim.org>
parents:
27916
diff
changeset
|
3279 |
28183
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3280 " Test for :scriptnames argument completion |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3281 func Test_cmdline_complete_scriptnames() |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3282 set wildmenu |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
3283 call writefile(['let a = 1'], 'Xa1b2c3.vim', 'D') |
28183
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3284 source Xa1b2c3.vim |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3285 call feedkeys(":script \<Tab>\<Left>\<Left>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3286 call assert_match("\"script .*Xa1b2c3.vim$", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3287 call feedkeys(":script \<Tab>\<Left>\<Left>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3288 call assert_match("\"script .*Xa1b2c3.vim$", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3289 call feedkeys(":script b2c3\<Tab>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3290 call assert_equal("\"script b2c3", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3291 call feedkeys(":script 2\<Tab>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3292 call assert_match("\"script 2\<Tab>$", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3293 call feedkeys(":script \<Tab>\<Left>\<Left> \<Tab>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3294 call assert_match("\"script .*Xa1b2c3.vim $", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3295 call feedkeys(":script \<Tab>\<Left>\<C-B>\"\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3296 call assert_equal("\"script ", @:) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3297 call assert_match('Xa1b2c3.vim$', getcompletion('.*Xa1b2.*', 'scriptnames')[0]) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3298 call assert_equal([], getcompletion('Xa1b2', 'scriptnames')) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3299 new |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3300 call feedkeys(":script \<Tab>\<Left>\<Left>\<CR>", 'tx') |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3301 call assert_equal('Xa1b2c3.vim', fnamemodify(@%, ':t')) |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3302 bw! |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3303 set wildmenu& |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3304 endfunc |
2b595cee4c85
patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents:
28166
diff
changeset
|
3305 |
28741
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3306 " this was going over the end of IObuff |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3307 func Test_report_error_with_composing() |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3308 let caught = 'no' |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3309 try |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3310 exe repeat('0', 987) .. "0\xdd\x80\xdd\x80\xdd\x80\xdd\x80" |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3311 catch /E492:/ |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3312 let caught = 'yes' |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3313 endtry |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3314 call assert_equal('yes', caught) |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3315 endfunc |
b44f15083faf
patch 8.2.4895: buffer overflow with invalid command with composing chars
Bram Moolenaar <Bram@vim.org>
parents:
28530
diff
changeset
|
3316 |
28205
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3317 " Test for expanding 2-letter and 3-letter :substitute command arguments. |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3318 " These commands don't accept an argument. |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3319 func Test_cmdline_complete_substitute_short() |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3320 for cmd in ['sc', 'sce', 'scg', 'sci', 'scI', 'scn', 'scp', 'scl', |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3321 \ 'sgc', 'sge', 'sg', 'sgi', 'sgI', 'sgn', 'sgp', 'sgl', 'sgr', |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3322 \ 'sic', 'sie', 'si', 'siI', 'sin', 'sip', 'sir', |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3323 \ 'sIc', 'sIe', 'sIg', 'sIi', 'sI', 'sIn', 'sIp', 'sIl', 'sIr', |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3324 \ 'src', 'srg', 'sri', 'srI', 'srn', 'srp', 'srl', 'sr'] |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3325 call feedkeys(':' .. cmd .. " \<Tab>\<C-B>\"\<CR>", 'tx') |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3326 call assert_equal('"' .. cmd .. " \<Tab>", @:) |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3327 endfor |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3328 endfunc |
553ff405b719
patch 8.2.4628: not enough testing for 2/3 letter substitute commands
Bram Moolenaar <Bram@vim.org>
parents:
28183
diff
changeset
|
3329 |
29495
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3330 " Test for :! shell command argument completion |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3331 func Test_cmdline_complete_bang_cmd_argument() |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3332 set wildoptions=fuzzy |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3333 call feedkeys(":!vim test_cmdline.\<Tab>\<C-B>\"\<CR>", 'xt') |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3334 call assert_equal('"!vim test_cmdline.vim', @:) |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3335 set wildoptions& |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3336 call feedkeys(":!vim test_cmdline.\<Tab>\<C-B>\"\<CR>", 'xt') |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3337 call assert_equal('"!vim test_cmdline.vim', @:) |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3338 endfunc |
82b0aeaeaa3c
patch 9.0.0089: fuzzy argument completion doesn't work for shell commands
Bram Moolenaar <Bram@vim.org>
parents:
29489
diff
changeset
|
3339 |
28757
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3340 func Check_completion() |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3341 call assert_equal('let a', getcmdline()) |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3342 call assert_equal(6, getcmdpos()) |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3343 call assert_equal(7, getcmdscreenpos()) |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3344 call assert_equal('var', getcmdcompltype()) |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3345 return '' |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3346 endfunc |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3347 |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3348 func Test_screenpos_and_completion() |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3349 call feedkeys(":let a\<C-R>=Check_completion()\<CR>\<Esc>", "xt") |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3350 endfunc |
add09d468c0d
patch 8.2.4903: cannot get the current cmdline completion type and position
Bram Moolenaar <Bram@vim.org>
parents:
28749
diff
changeset
|
3351 |
28905
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3352 func Test_recursive_register() |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3353 let @= = '' |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3354 silent! ?e/ |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3355 let caught = 'no' |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3356 try |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3357 normal // |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3358 catch /E169:/ |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3359 let caught = 'yes' |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3360 endtry |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3361 call assert_equal('yes', caught) |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3362 endfunc |
f3f45218f923
patch 8.2.4975: recursive command line loop may cause a crash
Bram Moolenaar <Bram@vim.org>
parents:
28757
diff
changeset
|
3363 |
29083
3de91964bbd6
patch 8.2.5063: error for a command may go over the end of IObuff
Bram Moolenaar <Bram@vim.org>
parents:
29054
diff
changeset
|
3364 func Test_long_error_message() |
3de91964bbd6
patch 8.2.5063: error for a command may go over the end of IObuff
Bram Moolenaar <Bram@vim.org>
parents:
29054
diff
changeset
|
3365 " the error should be truncated, not overrun IObuff |
3de91964bbd6
patch 8.2.5063: error for a command may go over the end of IObuff
Bram Moolenaar <Bram@vim.org>
parents:
29054
diff
changeset
|
3366 silent! norm Q00000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
3de91964bbd6
patch 8.2.5063: error for a command may go over the end of IObuff
Bram Moolenaar <Bram@vim.org>
parents:
29054
diff
changeset
|
3367 endfunc |
3de91964bbd6
patch 8.2.5063: error for a command may go over the end of IObuff
Bram Moolenaar <Bram@vim.org>
parents:
29054
diff
changeset
|
3368 |
29489
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3369 func Test_cmdline_redraw_tabline() |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3370 CheckRunVimInTerminal |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3371 |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3372 let lines =<< trim END |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3373 set showtabline=2 |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3374 autocmd CmdlineEnter * set tabline=foo |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3375 END |
30164
f7a2de8a4ddc
patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
30049
diff
changeset
|
3376 call writefile(lines, 'Xcmdline_redraw_tabline', 'D') |
29489
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3377 let buf = RunVimInTerminal('-S Xcmdline_redraw_tabline', #{rows: 6}) |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3378 call term_sendkeys(buf, ':') |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3379 call WaitForAssert({-> assert_match('^foo', term_getline(buf, 1))}) |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3380 |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3381 call StopVimInTerminal(buf) |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3382 endfunc |
7c639dff32dd
patch 9.0.0086: tabline is not redrawn when entering command line
Bram Moolenaar <Bram@vim.org>
parents:
29479
diff
changeset
|
3383 |
29794
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3384 func Test_wildmenu_pum_disable_while_shown() |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3385 set wildoptions=pum |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3386 set wildmenu |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3387 cnoremap <F2> <Cmd>set nowildmenu<CR> |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3388 call feedkeys(":sign \<Tab>\<F2>\<Esc>", 'tx') |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3389 call assert_equal(0, pumvisible()) |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3390 cunmap <F2> |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3391 set wildoptions& wildmenu& |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3392 endfunc |
5b46eb13e3bb
patch 9.0.0236: popup menu not removed when 'wildmenu' reset while visible
Bram Moolenaar <Bram@vim.org>
parents:
29702
diff
changeset
|
3393 |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3394 func Test_setcmdline() |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3395 func SetText(text, pos) |
29964
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3396 autocmd CmdlineChanged * let g:cmdtype = expand('<afile>') |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3397 call assert_equal(0, setcmdline(a:text)) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3398 call assert_equal(a:text, getcmdline()) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3399 call assert_equal(len(a:text) + 1, getcmdpos()) |
29964
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3400 call assert_equal(getcmdtype(), g:cmdtype) |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3401 unlet g:cmdtype |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3402 autocmd! CmdlineChanged |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3403 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3404 call assert_equal(0, setcmdline(a:text, a:pos)) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3405 call assert_equal(a:text, getcmdline()) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3406 call assert_equal(a:pos, getcmdpos()) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3407 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3408 call assert_fails('call setcmdline("' .. a:text .. '", -1)', 'E487:') |
29922
b366b19d1a3e
patch 9.0.0299: error messages for setcmdline() could be better
Bram Moolenaar <Bram@vim.org>
parents:
29894
diff
changeset
|
3409 call assert_fails('call setcmdline({}, 0)', 'E1174:') |
b366b19d1a3e
patch 9.0.0299: error messages for setcmdline() could be better
Bram Moolenaar <Bram@vim.org>
parents:
29894
diff
changeset
|
3410 call assert_fails('call setcmdline("' .. a:text .. '", {})', 'E1210:') |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3411 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3412 return '' |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3413 endfunc |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3414 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3415 call feedkeys(":\<C-R>=SetText('set rtp?', 2)\<CR>\<CR>", 'xt') |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3416 call assert_equal('set rtp?', @:) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3417 |
29964
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3418 call feedkeys(":let g:str = input('? ')\<CR>", 't') |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3419 call feedkeys("\<C-R>=SetText('foo', 4)\<CR>\<CR>", 'xt') |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3420 call assert_equal('foo', g:str) |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3421 unlet g:str |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3422 |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3423 delfunc SetText |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3424 |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3425 " setcmdline() returns 1 when not editing the command line. |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3426 call assert_equal(1, 'foo'->setcmdline()) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3427 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3428 " Called in custom function |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3429 func CustomComplete(A, L, P) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3430 call assert_equal(0, setcmdline("DoCmd ")) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3431 return "January\nFebruary\nMars\n" |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3432 endfunc |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3433 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3434 com! -nargs=* -complete=custom,CustomComplete DoCmd : |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3435 call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx') |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3436 call assert_equal('"DoCmd January February Mars', @:) |
29964
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3437 delcom DoCmd |
444dd4cc49d6
patch 9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Bram Moolenaar <Bram@vim.org>
parents:
29922
diff
changeset
|
3438 delfunc CustomComplete |
29894
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3439 |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3440 " Called in <expr> |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3441 cnoremap <expr>a setcmdline('let foo=') |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3442 call feedkeys(":a\<CR>", 'tx') |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3443 call assert_equal('let foo=0', @:) |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3444 cunmap a |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3445 endfunc |
d8fc1effa724
patch 9.0.0285: it is not easy to change the command line from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
29798
diff
changeset
|
3446 |
18804
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
3447 " vim: shiftwidth=2 sts=2 expandtab |