Mercurial > vim
annotate src/testdir/test_cmdline.vim @ 26927:e3f3108a780a v8.2.3992
patch 8.2.3992: wrong local-additions in the help with language mix
Commit: https://github.com/vim/vim/commit/0e2508d9e63e63414de2c06b3c8a446fdfe4470b
Author: h-east <h.east.727@gmail.com>
Date: Mon Jan 3 12:53:24 2022 +0000
patch 8.2.3992: wrong local-additions in the help with language mix
Problem: Wrong local-additions in the help with language mix.
Solution: Adjust how the local additions list is generated. (Hirohito
Higashi, closes #9464)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 Jan 2022 14:00:04 +0100 |
parents | ee1c116b91ea |
children | 4eb2bf8b2f27 |
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 |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
7 |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 func Test_complete_tab() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call writefile(['testfile'], 'Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call feedkeys(":e Xtest\t\r", "tx") |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 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
|
12 |
ba9d587f0b29
patch 8.2.3378: MS-Windows: completing environment variables with % is wrong
Bram Moolenaar <Bram@vim.org>
parents:
25682
diff
changeset
|
13 " 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
|
14 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
|
15 call assert_equal('e Xtestfile', @:) |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call delete('Xtestfile') |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 func Test_complete_list() |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " 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
|
21 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
|
22 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
|
23 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
24 " 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
|
25 " used. |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
26 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
|
27 call assert_equal("\"chistory \<C-D>", @:) |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 endfunc |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 func Test_complete_wildmenu() |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
31 call mkdir('Xdir1/Xdir2', 'p') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
32 call writefile(['testfile1'], 'Xdir1/Xtestfile1') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
33 call writefile(['testfile2'], 'Xdir1/Xtestfile2') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
34 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile3') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
35 call writefile(['testfile3'], 'Xdir1/Xdir2/Xtestfile4') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 set wildmenu |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
37 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
38 " Pressing <Tab> completes, and moves to next files when pressing again. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
39 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
40 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
|
41 call feedkeys(":e Xdir1/\<Tab>\<Tab>\<Tab>\<CR>", 'tx') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 call assert_equal('testfile2', getline(1)) |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
44 " <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
|
45 " previous. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
46 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
47 call assert_equal('testfile2', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
48 call feedkeys(":e Xdir1/Xtest\<S-Tab>\<S-Tab>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
49 call assert_equal('testfile1', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
50 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
51 " <Left>/<Right> to move to previous/next file. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
52 call feedkeys(":e Xdir1/\<Tab>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
53 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
|
54 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
55 call assert_equal('testfile2', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
56 call feedkeys(":e Xdir1/\<Tab>\<Right>\<Right>\<Left>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
57 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
|
58 |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
59 " <Up>/<Down> to go up/down directories. |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
60 call feedkeys(":e Xdir1/\<Tab>\<Down>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
61 call assert_equal('testfile3', getline(1)) |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
62 call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
63 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
|
64 |
23382
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
65 " 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
|
66 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
|
67 " <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
|
68 " 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
|
69 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
|
70 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
|
71 cnoremap <C-K> <Up><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
|
72 call feedkeys(":e Xdir1/\<Tab>\<C-J>\<CR>", 'tx') |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
73 call assert_equal('testfile3', 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
|
74 call feedkeys(":e Xdir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx') |
7d6bffda5b6b
patch 8.2.2234: command line wildmenu test often fails with Unix GUI
Bram Moolenaar <Bram@vim.org>
parents:
23356
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
81 " 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
|
82 redrawstatus |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
83 call feedkeys(":e Xdir1/\<Tab>x\<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
|
84 call assert_equal('"e Xdir1/Xdir2/x', @:) |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
85 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
86 " Completion using a relative path |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
87 cd Xdir1/Xdir2 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
88 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
|
89 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
|
90 cd - |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
91 |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
92 cnoremap <expr> <F2> wildmenumode() |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
93 call feedkeys(":cd Xdir\<Tab>\<F2>\<C-B>\"\<CR>", 'tx') |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
94 call assert_equal('"cd Xdir1/1', @:) |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
95 cunmap <F2> |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
96 |
16117
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
97 " cleanup |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
98 %bwipe |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
99 call delete('Xdir1/Xdir2/Xtestfile4') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
100 call delete('Xdir1/Xdir2/Xtestfile3') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
101 call delete('Xdir1/Xtestfile2') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
102 call delete('Xdir1/Xtestfile1') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
103 call delete('Xdir1/Xdir2', 'd') |
dd15295b94fe
patch 8.1.1063: insufficient testing for wildmenu completion
Bram Moolenaar <Bram@vim.org>
parents:
15657
diff
changeset
|
104 call delete('Xdir1', 'd') |
9280
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 set nowildmenu |
f92cfcd7fda2
commit https://github.com/vim/vim/commit/ae3150ec8d9da4a244acffebea55416946ca23d3
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 endfunc |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
107 |
22061
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
108 func Test_wildmenu_screendump() |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
109 CheckScreendump |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
110 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
111 let lines =<< trim [SCRIPT] |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
112 set wildmenu hlsearch |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
113 [SCRIPT] |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
114 call writefile(lines, 'XTest_wildmenu') |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
115 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
116 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
|
117 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
|
118 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
|
119 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
120 call term_sendkeys(buf, "\<Tab>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
121 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
|
122 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
123 call term_sendkeys(buf, "\<Tab>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
124 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
|
125 |
23938
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23853
diff
changeset
|
126 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
|
127 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
|
128 call term_sendkeys(buf, "\<Esc>") |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
129 |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
130 " clean up |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
131 call StopVimInTerminal(buf) |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
132 call delete('XTest_wildmenu') |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
133 endfunc |
d6120c97f57c
patch 8.2.1580: wildmenu does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
134 |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
135 func Test_map_completion() |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
151 map <Middle>x middle |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
152 |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
153 map ,f commaf |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
154 map ,g commaf |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
155 map <Left> left |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
156 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
|
157 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
|
158 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
|
159 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
|
160 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
|
161 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
|
162 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
|
163 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
|
164 call assert_equal("\"map <A-Left>\<Tab>", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
165 unmap ,f |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
166 unmap ,g |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
167 unmap <Left> |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
168 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
|
169 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
170 set cpo-=< cpo-=B cpo-=k |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
171 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 call assert_equal("\"map <M\<Tab>", getreg(':')) |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
176 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
177 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
178 set cpo+=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
179 map <Left> left |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
180 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
|
181 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
|
182 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
|
183 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
|
184 if !has('gui_running') |
1c8a90c4d2a1
patch 8.1.1268: map completion test fails in GUI
Bram Moolenaar <Bram@vim.org>
parents:
16501
diff
changeset
|
185 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
|
186 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
|
187 endif |
16495
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
188 unmap <Left> |
16501
5273b506b050
patch 8.1.1254: mapping completion contains dead code
Bram Moolenaar <Bram@vim.org>
parents:
16499
diff
changeset
|
189 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
|
190 set cpo-=< |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
191 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
192 set cpo+=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
193 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
194 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
|
195 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
|
196 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
197 set cpo-=B |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
198 |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
199 set cpo+=k |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
200 map <Left> left |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
201 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
|
202 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
|
203 unmap <Left> |
899db156cce3
patch 8.1.1251: no test for completion of mapping keys
Bram Moolenaar <Bram@vim.org>
parents:
16117
diff
changeset
|
204 set cpo-=k |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
205 |
22375
595ea7f099cd
patch 8.2.1736: failure to compile a pattern not tested much
Bram Moolenaar <Bram@vim.org>
parents:
22169
diff
changeset
|
206 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
|
207 |
16497
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
208 unmap <Middle>x |
ac4e38fbae9d
patch 8.1.1252: not all mapping completion is tested
Bram Moolenaar <Bram@vim.org>
parents:
16495
diff
changeset
|
209 set cpo&vim |
11026
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
210 endfunc |
fa69f6272692
patch 8.0.0402: :map completion does not have <special>
Christian Brabandt <cb@256bit.org>
parents:
10869
diff
changeset
|
211 |
10660
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
212 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
|
213 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
|
214 call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
215 call assert_equal('"match Aardig', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
216 call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt') |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
217 call assert_equal('"match none', getreg(':')) |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
218 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
219 |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
220 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
|
221 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
|
222 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
|
223 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
|
224 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
|
225 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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 |
918942a3b0ef
patch 8.0.0513: getting name of cleared highlight group is wrong
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
239 " 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 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
|
246 endfunc |
715836a72361
patch 8.0.0220: completion of highlight names misses a few values
Christian Brabandt <cb@256bit.org>
parents:
10656
diff
changeset
|
247 |
21052
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
248 " 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
|
249 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
|
250 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
|
251 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
|
252 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
|
253 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
|
254 endfunc |
f3c72001de63
patch 8.2.1077: no enough test coverage for highlighting
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
255 |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
256 func Test_getcompletion() |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
257 let groupcount = len(getcompletion('', 'event')) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
258 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
|
259 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
|
260 call assert_true(matchcount > 0) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
261 call assert_true(groupcount > matchcount) |
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
262 |
9462
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
263 if has('menu') |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
264 source $VIMRUNTIME/menu.vim |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
265 let matchcount = len(getcompletion('', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
266 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
267 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
|
268 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
269 let matchcount = len(getcompletion('File.', 'menu')) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
270 call assert_true(matchcount > 0) |
7384c0cfad13
commit https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f
Christian Brabandt <cb@256bit.org>
parents:
9460
diff
changeset
|
271 endif |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
272 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
273 let l = getcompletion('v:n', 'var') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
274 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
|
275 let l = getcompletion('v:notexists', 'var') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
276 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
277 |
13551
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
278 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
|
279 let l = getcompletion('', 'arglist') |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
280 call assert_equal(['a.c', 'b.c'], l) |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
281 %argdelete |
1fd0f8392946
patch 8.0.1649: no completion for argument list commands
Christian Brabandt <cb@256bit.org>
parents:
12706
diff
changeset
|
282 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
283 let l = getcompletion('', 'augroup') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
284 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
|
285 let l = getcompletion('blahblah', 'augroup') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
286 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
287 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
288 let l = getcompletion('', 'behave') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
289 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
|
290 let l = getcompletion('not', 'behave') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
291 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
292 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
293 let l = getcompletion('', 'color') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
294 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
|
295 let l = getcompletion('dirty', 'color') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
296 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
297 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
298 let l = getcompletion('', 'command') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
299 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
|
300 let l = getcompletion('awake', 'command') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
301 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
302 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
303 let l = getcompletion('', 'dir') |
9672
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
304 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
|
305 let l = getcompletion('NoMatch', 'dir') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
306 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
307 |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
308 if glob('~/*') !=# '' |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
309 let l = getcompletion('~/', 'dir') |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
310 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
|
311 endif |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
312 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
313 let l = getcompletion('exe', 'expression') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
314 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
|
315 let l = getcompletion('kill', 'expression') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
316 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
317 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
318 let l = getcompletion('tag', 'function') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
319 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
|
320 let l = getcompletion('paint', 'function') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
321 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
322 |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
323 let Flambda = {-> 'hello'} |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
324 let l = getcompletion('', 'function') |
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
325 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
|
326 call assert_equal([], l) |
9638
af0d98d8836e
commit https://github.com/vim/vim/commit/b49edc11a1872fa99befa9a4a8ea6c8537868038
Christian Brabandt <cb@256bit.org>
parents:
9577
diff
changeset
|
327 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
328 let l = getcompletion('run', 'file') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
329 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
|
330 let l = getcompletion('walk', 'file') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
331 call assert_equal([], l) |
9861
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
332 set wildignore=*.vim |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
333 let l = getcompletion('run', 'file', 1) |
74f67cb4f7e1
commit https://github.com/vim/vim/commit/e9d58a6459687a1228b5aa85bd7b31f8f1e528a8
Christian Brabandt <cb@256bit.org>
parents:
9774
diff
changeset
|
334 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
|
335 set wildignore& |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
336 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
337 let l = getcompletion('ha', 'filetype') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
338 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
|
339 let l = getcompletion('horse', 'filetype') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
340 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
341 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
342 let l = getcompletion('z', 'syntax') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
343 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
|
344 let l = getcompletion('emacs', 'syntax') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
345 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
346 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
347 let l = getcompletion('jikes', 'compiler') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
348 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
|
349 let l = getcompletion('break', 'compiler') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
350 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
351 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
352 let l = getcompletion('last', 'help') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
353 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
|
354 let l = getcompletion('giveup', 'help') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
355 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
356 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
357 let l = getcompletion('time', 'option') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
358 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
|
359 let l = getcompletion('space', 'option') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
360 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
361 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
362 let l = getcompletion('er', 'highlight') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
363 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
|
364 let l = getcompletion('dark', 'highlight') |
6255ff1ea003
commit https://github.com/vim/vim/commit/b56195ed00a9a79aa6217cddbeedbc8cc7a5b6d8
Christian Brabandt <cb@256bit.org>
parents:
9638
diff
changeset
|
365 call assert_equal([], l) |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
366 |
10275
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
367 let l = getcompletion('', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
368 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
|
369 let l = getcompletion('not', 'messages') |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
370 call assert_equal([], l) |
6d8b2da002e9
commit https://github.com/vim/vim/commit/9e507ca8a3e1535e62de4bd86374b0fcd18ef5b8
Christian Brabandt <cb@256bit.org>
parents:
10007
diff
changeset
|
371 |
11995
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
372 let l = getcompletion('', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
373 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
|
374 let l = getcompletion('not', 'mapclear') |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
375 call assert_equal([], l) |
7df3dd3c0ac1
patch 8.0.0878: no completion for :mapclear
Christian Brabandt <cb@256bit.org>
parents:
11354
diff
changeset
|
376 |
13998
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
377 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
|
378 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
|
379 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
|
380 let root = has('win32') ? 'C:\\' : '/' |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
381 let l = getcompletion(root, 'shellcmd') |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
382 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
|
383 \ '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
|
384 call assert_equal(expected, l) |
c3f9c37160e7
patch 8.1.0017: shell command completion has duplicates
Christian Brabandt <cb@256bit.org>
parents:
13890
diff
changeset
|
385 |
9766
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
386 if has('cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
387 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
388 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
|
389 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
390 " 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
|
391 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
|
392 let l = getcompletion('', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
393 call assert_equal(cmds, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
394 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
|
395 let l = getcompletion('find ', 'cscope') |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
396 call assert_equal(keys, l) |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
397 endif |
be9b5f8c3fd9
commit https://github.com/vim/vim/commit/b650b9878e9f0ac6bb1b61230095ad9ab3850a33
Christian Brabandt <cb@256bit.org>
parents:
9672
diff
changeset
|
398 |
9774
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
399 if has('signs') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
400 sign define Testing linehl=Comment |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
401 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
402 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
|
403 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
404 " 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
|
405 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
|
406 let l = getcompletion('', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
407 call assert_equal(cmds, l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
408 let l = getcompletion('list ', 'sign') |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
409 call assert_equal(['Testing'], l) |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
410 endif |
5385e72e1ac2
commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Christian Brabandt <cb@256bit.org>
parents:
9766
diff
changeset
|
411 |
20745
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
412 " 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 |
26032
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
426 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
|
427 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
|
428 return "oneA\noneB\noneC" |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
429 endfunc |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
430 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
|
431 let l = getcompletion('MyCmd ', 'cmdline') |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
432 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
|
433 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
|
434 |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
435 delcommand MyCmd |
162ef12a3b5f
patch 8.2.3550: completion() does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
25996
diff
changeset
|
436 delfunc T |
26213
ee1c116b91ea
patch 8.2.3638: getcompletion() always passes zero as position
Bram Moolenaar <Bram@vim.org>
parents:
26153
diff
changeset
|
437 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
|
438 |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
439 " 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
|
440 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
|
441 if has('cmdline_hist') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
442 call add(names, 'history') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
443 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
444 if has('gettext') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
445 call add(names, 'locale') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
446 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
447 if has('profile') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
448 call add(names, 'syntime') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
449 endif |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
450 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
451 set tags=Xtags |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
452 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags') |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
453 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
454 for name in names |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
455 let matchcount = len(getcompletion('', name)) |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
456 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
|
457 endfor |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
458 |
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
459 call delete('Xtags') |
17093
5cda6165a5c1
patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents:
16529
diff
changeset
|
460 set tags& |
9577
e3b6a4a87684
commit https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9
Christian Brabandt <cb@256bit.org>
parents:
9462
diff
changeset
|
461 |
20990
55b3849ded11
patch 8.2.1046: insufficient tests for src/buffer.c
Bram Moolenaar <Bram@vim.org>
parents:
20911
diff
changeset
|
462 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
|
463 call assert_fails('call getcompletion("", "burp")', 'E475:') |
20745
49673325ca13
patch 8.2.0925: getcompletion() does not return command line arguments
Bram Moolenaar <Bram@vim.org>
parents:
20741
diff
changeset
|
464 call assert_fails('call getcompletion("abc", [])', 'E475:') |
9460
cdffa812f9d1
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Christian Brabandt <cb@256bit.org>
parents:
9280
diff
changeset
|
465 endfunc |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
466 |
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
|
467 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
|
468 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
|
469 \ '': '', |
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
|
470 \ ':': '', |
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
|
471 \ ':::': '', |
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
|
472 \ ':::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
|
473 \ '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
|
474 \ '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
|
475 \ '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
|
476 \ ':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
|
477 \ '::::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
|
478 \ '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
|
479 \ '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
|
480 \ '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
|
481 \ ':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
|
482 \ '::::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
|
483 \ '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
|
484 \ '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
|
485 \ '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
|
486 \ '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
|
487 \ 'abo': '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
|
488 \ '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
|
489 \ '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
|
490 \ ':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
|
491 \ "'<,'>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
|
492 \ ":'<,'>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
|
493 \ 'CheckUni': 'CheckUnix', |
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
|
494 \ 'CheckUnix': 'CheckUnix', |
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
|
495 \ } |
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
|
496 |
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
|
497 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
|
498 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
|
499 endfor |
24697
a6e43da449af
patch 8.2.2887: crash when passing null string to fullcommand()
Bram Moolenaar <Bram@vim.org>
parents:
24669
diff
changeset
|
500 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
|
501 |
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
|
502 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
|
503 |
589226a5f317
patch 8.2.3414: fullcommand() gives wrong name with buffer-local user command
Bram Moolenaar <Bram@vim.org>
parents:
25713
diff
changeset
|
504 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
|
505 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
|
506 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
|
507 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
|
508 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
|
509 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
|
510 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
|
511 |
14417
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
512 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
|
513 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
|
514 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
515 call mkdir('Xpathdir/Xpathsubdir', 'p') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
516 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
|
517 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
|
518 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
519 " 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
|
520 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
|
521 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
522 " 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
|
523 " 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
|
524 " 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
|
525 " suggestions. |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
526 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
|
527 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
|
528 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
|
529 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
|
530 |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
531 call delete('Xpathdir', 'rf') |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
532 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
|
533 endfunc |
5d9b450e7827
patch 8.1.0223: completing shell command finds sub-directories in $PATH
Christian Brabandt <cb@256bit.org>
parents:
14167
diff
changeset
|
534 |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
535 func Test_expand_star_star() |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
536 call mkdir('a/b', 'p') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
537 call writefile(['asdfasdf'], 'a/b/fileXname') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
538 call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
539 call assert_equal('find a/b/fileXname', getreg(':')) |
10007
a4d4ee212dab
commit https://github.com/vim/vim/commit/1773ddfdcd106fa3bbf479c9b62ccde03c2a86ba
Christian Brabandt <cb@256bit.org>
parents:
10002
diff
changeset
|
540 bwipe! |
10002
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
541 call delete('a', 'rf') |
ff0b4216f026
commit https://github.com/vim/vim/commit/73d4e4c8922f6f4d256f910a18f47c0c3a48c28b
Christian Brabandt <cb@256bit.org>
parents:
9861
diff
changeset
|
542 endfunc |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
543 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
544 func Test_cmdline_paste() |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
545 let @a = "def" |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
546 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
|
547 call assert_equal('"abc def ghi', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
548 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
549 new |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
550 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
|
551 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
552 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
|
553 call assert_equal('"aaa asdf bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
554 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
555 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
|
556 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
|
557 |
13831
1f95ec5de238
patch 8.0.1787: cannot insert the whole cursor line
Christian Brabandt <cb@256bit.org>
parents:
13600
diff
changeset
|
558 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
|
559 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
|
560 |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
561 set incsearch |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
562 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
|
563 call assert_equal('"aaa verylongword bbb', @:) |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
564 |
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
565 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
|
566 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
|
567 |
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
568 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
|
569 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
|
570 bwipe! |
13600
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
571 |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
572 " 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
|
573 " 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
|
574 new |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
575 try |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
576 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
|
577 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
|
578 " 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
|
579 endtry |
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
580 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
|
581 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
582 " 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
|
583 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
|
584 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
|
585 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
586 " 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
|
587 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
|
588 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
|
589 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
|
590 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
|
591 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
|
592 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
|
593 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
|
594 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
595 " 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
|
596 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
|
597 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
|
598 call assert_equal('"xyz', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
599 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
|
600 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
|
601 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
602 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
|
603 |
13600
75e35ebdb7a4
patch 8.0.1672: error during completion causes command to be cancelled
Christian Brabandt <cb@256bit.org>
parents:
13551
diff
changeset
|
604 bwipe! |
10452
3fab458a54ad
commit https://github.com/vim/vim/commit/21efc3633edb58809c5dd89b025d34d7002e731c
Christian Brabandt <cb@256bit.org>
parents:
10275
diff
changeset
|
605 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
606 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
607 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
|
608 let encoding_save = &encoding |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
609 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
610 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
|
611 exe 'set encoding=' . e |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
612 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
613 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
|
614 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
|
615 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
616 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
|
617 call assert_equal('"abcdef', @:) |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
618 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
619 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
|
620 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
|
621 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
622 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
|
623 call assert_equal('"def', @:, e) |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
624 endfor |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
625 |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
626 let &encoding = encoding_save |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
627 endfunc |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
628 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
629 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
|
630 CheckFeature keymap |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
631 |
18924
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
632 set keymap=esperanto |
a18d7782b80f
patch 8.2.0023: command line editing not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
18804
diff
changeset
|
633 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
|
634 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
|
635 set keymap= |
10464
ce8ef728a12e
commit https://github.com/vim/vim/commit/eaaa9bbda6ec0a8589a9b23720f95bffe01dc267
Christian Brabandt <cb@256bit.org>
parents:
10452
diff
changeset
|
636 endfunc |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
637 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
638 func Test_illegal_address1() |
10480
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
639 new |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
640 2;'( |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
641 2;') |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
642 quit |
dc9326b58c33
commit https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c
Christian Brabandt <cb@256bit.org>
parents:
10464
diff
changeset
|
643 endfunc |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
644 |
10869
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
645 func Test_illegal_address2() |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
646 call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
647 new |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
648 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
|
649 " 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
|
650 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
|
651 quit! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
652 bwipe! |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
653 call delete('Xtest.vim') |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
654 endfunc |
f8ebfa168818
patch 8.0.0324: illegal memory access with a wrong yank range
Christian Brabandt <cb@256bit.org>
parents:
10867
diff
changeset
|
655 |
10694
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
656 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
|
657 help |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
658 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
|
659 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
|
660 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
|
661 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
|
662 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
|
663 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
|
664 bw! |
fa6c4825a1c4
patch 8.0.0237: when 'wildoptions' is "tagfile" completion may not work
Christian Brabandt <cb@256bit.org>
parents:
10660
diff
changeset
|
665 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
|
666 |
11279
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
667 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
|
668 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
|
669 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
|
670 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
|
671 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
|
672 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
|
673 delcommand Foo |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
674 endfunc |
b19377368387
patch 8.0.0525: completion for user command argument not tested
Christian Brabandt <cb@256bit.org>
parents:
11254
diff
changeset
|
675 |
19556
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
676 func s:ScriptLocalFunction() |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
677 echo 'yes' |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
678 endfunc |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
679 |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
680 func Test_cmdline_complete_user_func() |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
681 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
|
682 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
|
683 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
|
684 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
|
685 |
a9433f834693
patch 8.2.2341: expresison command line completion incomplete after "g:"
Bram Moolenaar <Bram@vim.org>
parents:
23382
diff
changeset
|
686 " 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
|
687 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
|
688 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
|
689 |
df3d056b4663
patch 8.2.3337: completing "call g:" returns entries with just "g:"
Bram Moolenaar <Bram@vim.org>
parents:
24909
diff
changeset
|
690 " 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
|
691 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
|
692 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
|
693 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
|
694 |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
695 " 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
|
696 " completion |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
697 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
|
698 endfunction |
46e2b5f66800
patch 8.2.3360: user function completion fails with dict function
Bram Moolenaar <Bram@vim.org>
parents:
25617
diff
changeset
|
699 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
|
700 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
|
701 delfunction s:a_dict_func |
19556
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
702 endfunc |
ff5048b0ccfe
patch 8.2.0335: no completion for :disassemble
Bram Moolenaar <Bram@vim.org>
parents:
19550
diff
changeset
|
703 |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
704 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
|
705 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
|
706 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
|
707 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
|
708 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
|
709 " 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
|
710 " 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
|
711 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
|
712 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
|
713 endif |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
714 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
|
715 " 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
|
716 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
|
717 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
|
718 " 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
|
719 " 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
|
720 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
|
721 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
|
722 endif |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
723 else |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
724 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
|
725 endif |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
726 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
727 |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
728 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
|
729 CheckExecutable whoami |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
730 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
|
731 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
|
732 endfunc |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
733 |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19689
diff
changeset
|
734 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
|
735 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
|
736 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
|
737 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
738 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
|
739 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
|
740 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
741 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
|
742 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
|
743 |
14135
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
744 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
|
745 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
|
746 |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
747 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
|
748 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
|
749 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
750 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
|
751 |
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
752 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
|
753 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
|
754 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
755 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
|
756 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
|
757 |
20818
a0b147774bd4
patch 8.2.0961: MS-Windows: no completion for locales
Bram Moolenaar <Bram@vim.org>
parents:
20747
diff
changeset
|
758 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
|
759 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
|
760 |
69055d27e85e
patch 8.2.0988: getting directory contents is always case sorted
Bram Moolenaar <Bram@vim.org>
parents:
20818
diff
changeset
|
761 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
|
762 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
|
763 endfunc |
ee649db58c41
patch 8.1.0085: no test for completing user name and language
Christian Brabandt <cb@256bit.org>
parents:
13998
diff
changeset
|
764 |
18977
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
765 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
|
766 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
|
767 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
|
768 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
|
769 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
|
770 endfunc |
5bef1043abff
patch 8.2.0049: command line completion not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
18924
diff
changeset
|
771 |
23322
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
772 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
|
773 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
|
774 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
|
775 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
|
776 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
|
777 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
|
778 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
|
779 endfor |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
780 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
|
781 endfunc |
68df9697667a
patch 8.2.2206: :exe command line completion only works for first argument
Bram Moolenaar <Bram@vim.org>
parents:
22967
diff
changeset
|
782 |
25682
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
783 " 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
|
784 func s:WeirdFunc() |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
785 echo 'weird' |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
786 endfunc |
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
787 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
788 " Test for various command-line completion |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
789 func Test_cmdline_complete_various() |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
790 " 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
|
791 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
|
792 call assert_equal("\" :|\"\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
793 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
794 " 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
|
795 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
|
796 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
|
797 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
798 " completion for :k command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
799 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
|
800 call assert_equal("\"ka\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
801 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
802 " 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
|
803 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
|
804 call assert_equal("\"sI \<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
805 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
806 " completion for :write command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
807 call mkdir('Xdir') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
808 call writefile(['one'], 'Xdir/Xfile1') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
809 let save_cwd = getcwd() |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
810 cd Xdir |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
811 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
|
812 call assert_equal("\"w >> Xfile1", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
813 call chdir(save_cwd) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
814 call delete('Xdir', 'rf') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
815 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
816 " completion for :w ! and :r ! commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
817 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
|
818 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
|
819 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
|
820 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
|
821 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
822 " completion for :>> and :<< commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
823 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
|
824 call assert_equal("\">>>\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
825 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
|
826 call assert_equal("\"<<<\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
827 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
828 " completion for command with +cmd argument |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
829 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
|
830 call assert_equal("\"buffer +/pat Xabc", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
831 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
|
832 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
|
833 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
834 " 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
|
835 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
|
836 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
|
837 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
838 " 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
|
839 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
|
840 call assert_equal("\"ls | ls", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
841 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
842 " 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
|
843 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
|
844 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
|
845 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
846 " 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
|
847 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
|
848 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
|
849 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
850 " 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
|
851 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
|
852 call assert_equal("\"topleft new", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
853 |
24907
8388176a0954
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy
Bram Moolenaar <Bram@vim.org>
parents:
24743
diff
changeset
|
854 " 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
|
855 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
|
856 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
|
857 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
|
858 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
|
859 |
24909
09d222e89a84
patch 8.2.2992: Vim9: completion for :disassemble is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
24907
diff
changeset
|
860 " 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
|
861 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
|
862 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
|
863 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
|
864 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
|
865 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
|
866 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
|
867 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
|
868 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
|
869 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
|
870 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
|
871 |
25682
17ba70005a2e
patch 8.2.3377: Vim9: :disass completion does not understand "s:"
Bram Moolenaar <Bram@vim.org>
parents:
25654
diff
changeset
|
872 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
|
873 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
|
874 |
25792
47864a0f9055
patch 8.2.3431: completion for :disas sorts local functions first
Bram Moolenaar <Bram@vim.org>
parents:
25757
diff
changeset
|
875 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
|
876 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
|
877 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
|
878 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
|
879 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
880 " completion for the :match command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
881 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
|
882 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
|
883 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
884 " completion for the :s command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
885 call feedkeys(":s/from/to/g\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
886 call assert_equal("\"s/from/to/g\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
887 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
888 " completion for the :dlist command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
889 call feedkeys(":dlist 10 /pat/ 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
|
890 call assert_equal("\"dlist 10 /pat/ a\<C-A>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
891 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
892 " completion for the :doautocmd command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
893 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
|
894 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
|
895 |
22510
7060df0b8ebf
patch 8.2.1803: a few failures are not tested
Bram Moolenaar <Bram@vim.org>
parents:
22375
diff
changeset
|
896 " 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
|
897 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
|
898 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
|
899 |
25617
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
900 " completion of file name in :doautocmd |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
901 call writefile([], 'Xfile1') |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
902 call writefile([], 'Xfile2') |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
903 call feedkeys(":doautocmd BufEnter Xfi\<C-A>\<C-B>\"\<CR>", 'xt') |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
904 call assert_equal("\"doautocmd BufEnter Xfile1 Xfile2", @:) |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
905 call delete('Xfile1') |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
906 call delete('Xfile2') |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
907 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
908 " 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
|
909 augroup XTest.test |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
910 augroup END |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
911 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
|
912 call assert_equal("\"augroup XTest.test", @:) |
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
913 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
|
914 call assert_equal("\"au XTest.test", @:) |
2eddbc3d83b9
patch 8.2.3392: augroup completion escapes regexp pattern characters
Bram Moolenaar <Bram@vim.org>
parents:
25694
diff
changeset
|
915 augroup! XTest.test |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
916 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
917 " completion for the :unlet command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
918 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
|
919 call assert_equal("\"unlet one two", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
920 |
25994
e8873138ffbb
patch 8.2.3530: ":buf {a}" fails while ":edit {a}" works
Bram Moolenaar <Bram@vim.org>
parents:
25792
diff
changeset
|
921 " 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
|
922 " 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
|
923 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
|
924 edit \{someFile} |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
925 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
|
926 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
|
927 bwipe {someFile} |
94a8f120a06e
patch 8.2.3531: command line completion test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
25994
diff
changeset
|
928 endif |
25994
e8873138ffbb
patch 8.2.3530: ":buf {a}" fails while ":edit {a}" works
Bram Moolenaar <Bram@vim.org>
parents:
25792
diff
changeset
|
929 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
930 " completion for the :bdelete command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
931 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
|
932 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
|
933 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
934 " completion for the :mapclear command |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
935 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
|
936 call assert_equal("\"mapclear <buffer>", @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
937 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
938 " 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
|
939 menu Test.foo :ls<CR> |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
940 com -nargs=* -complete=menu MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
941 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
|
942 call assert_equal('"MyCmd Test.', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
943 delcom MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
944 unmenu Test |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
945 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
946 " 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
|
947 mapclear |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
948 map <F3> :ls<CR> |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
949 com -nargs=* -complete=mapping MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
950 call feedkeys(":MyCmd <F\<C-A>\<C-B>\"\<CR>", 'xt') |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
951 call assert_equal('"MyCmd <F3>', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
952 mapclear |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
953 delcom MyCmd |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
954 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
955 " 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
|
956 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
|
957 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
|
958 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
959 " 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
|
960 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
|
961 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
|
962 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
963 " completion for the :py3 commands |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
964 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
|
965 call assert_equal('"py3 py3do py3file', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
966 |
24256
b471a413d36a
patch 8.2.2669: command line completion does not work after "vim9"
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
967 " 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
|
968 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
|
969 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
|
970 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
971 " 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
|
972 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
|
973 call assert_equal('"redir @" | cwindow', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
974 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
975 " completion after a backtick |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
976 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
|
977 call assert_equal('"e `a1b2c', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
978 |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
979 " 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
|
980 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
|
981 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
|
982 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
983 " 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
|
984 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
|
985 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
|
986 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
987 " 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
|
988 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
|
989 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
|
990 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
|
991 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
|
992 delcom TCmd1 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
993 delcom TCmd2 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
994 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
995 " 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
|
996 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
|
997 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
|
998 |
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
|
999 " 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
|
1000 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
|
1001 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
|
1002 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
|
1003 " 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
|
1004 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
|
1005 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
|
1006 set wildchar& |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1007 endfunc |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1008 |
12706
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1009 func Test_cmdline_write_alternatefile() |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1010 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1011 call setline('.', ['one', 'two']) |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1012 f foo.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1013 new |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1014 f #-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1015 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
|
1016 f #<-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1017 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
|
1018 f %< |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1019 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
|
1020 new |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22061
diff
changeset
|
1021 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
|
1022 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1023 f foo-B.txt |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1024 f %<-A |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1025 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
|
1026 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1027 bw! |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1028 endfunc |
9b882316aa63
patch 8.0.1231: expanding file name drops dash
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
1029 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1030 " 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
|
1031 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
|
1032 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1033 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
|
1034 new |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1035 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
|
1036 /d |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1037 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
|
1038 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
|
1039 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1040 /a |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1041 $ |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1042 \?,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
|
1043 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
|
1044 |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1045 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
|
1046 %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
|
1047 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
|
1048 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
|
1049 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1050 let @/ = 'apple' |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21140
diff
changeset
|
1051 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
|
1052 |
10817
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1053 bwipe! |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1054 endfunc |
cc8079703414
patch 8.0.0298: Ex command range with repeated search does not work
Christian Brabandt <cb@256bit.org>
parents:
10694
diff
changeset
|
1055 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1056 " 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
|
1057 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
|
1058 " 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
|
1059 " 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
|
1060 call feedkeys(":'\<CR>", 'xt') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1061 call assert_equal("'", getreg(':')) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1062 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
|
1063 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1064 |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1065 " 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
|
1066 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
|
1067 new |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1068 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
|
1069 let @" = '' |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1070 2/foo/yank |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1071 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
|
1072 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
|
1073 close! |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1074 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1075 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1076 " 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
|
1077 func Check_cmdline(cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1078 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
|
1079 call assert_equal(8, getcmdpos()) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1080 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
|
1081 return '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1082 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1083 |
18043
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1084 set cpo& |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1085 |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1086 func Test_getcmdtype() |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1087 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
|
1088 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1089 let cmdtype = '' |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1090 debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1091 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
|
1092 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
|
1093 call feedkeys("cont\<CR>", "xt") |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1094 0debuggreedy |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1095 call assert_equal('>', cmdtype) |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1096 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1097 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
|
1098 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
|
1099 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1100 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
|
1101 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
|
1102 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1103 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
|
1104 |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1105 cnoremap <expr> <F6> Check_cmdline('=') |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1106 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
|
1107 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
|
1108 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1109 call assert_equal('', getcmdline()) |
10849
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1110 endfunc |
6ae12eba42b5
patch 8.0.0314: getcmd*() functions are not tested
Christian Brabandt <cb@256bit.org>
parents:
10817
diff
changeset
|
1111 |
14167
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1112 func Test_getcmdwintype() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1113 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1114 |
14167
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1115 call feedkeys("q/:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1116 call assert_equal('/', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1117 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1118 call feedkeys("q?:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1119 call assert_equal('?', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1120 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1121 call feedkeys("q::let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1122 call assert_equal(':', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1123 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1124 call feedkeys(":\<C-F>:let a = getcmdwintype()\<CR>:q\<CR>", 'x!') |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1125 call assert_equal(':', a) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1126 |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1127 call assert_equal('', getcmdwintype()) |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1128 endfunc |
3ca818b65cde
patch 8.1.0101: no test for getcmdwintype()
Christian Brabandt <cb@256bit.org>
parents:
14135
diff
changeset
|
1129 |
18043
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1130 func Test_getcmdwin_autocmd() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1131 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1132 |
18043
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1133 let s:seq = [] |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1134 augroup CmdWin |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1135 au WinEnter * call add(s:seq, 'WinEnter ' .. win_getid()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1136 au WinLeave * call add(s:seq, 'WinLeave ' .. win_getid()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1137 au BufEnter * call add(s:seq, 'BufEnter ' .. bufnr()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1138 au BufLeave * call add(s:seq, 'BufLeave ' .. bufnr()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1139 au CmdWinEnter * call add(s:seq, 'CmdWinEnter ' .. win_getid()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1140 au CmdWinLeave * call add(s:seq, 'CmdWinLeave ' .. win_getid()) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1141 |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1142 let org_winid = win_getid() |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1143 let org_bufnr = bufnr() |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1144 call feedkeys("q::let a = getcmdwintype()\<CR>:let s:cmd_winid = win_getid()\<CR>:let s:cmd_bufnr = bufnr()\<CR>:q\<CR>", 'x!') |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1145 call assert_equal(':', a) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1146 call assert_equal([ |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1147 \ 'WinLeave ' .. org_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1148 \ 'WinEnter ' .. s:cmd_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1149 \ 'BufLeave ' .. org_bufnr, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1150 \ 'BufEnter ' .. s:cmd_bufnr, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1151 \ 'CmdWinEnter ' .. s:cmd_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1152 \ 'CmdWinLeave ' .. s:cmd_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1153 \ 'BufLeave ' .. s:cmd_bufnr, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1154 \ 'WinLeave ' .. s:cmd_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1155 \ 'WinEnter ' .. org_winid, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1156 \ 'BufEnter ' .. org_bufnr, |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1157 \ ], s:seq) |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1158 |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1159 au! |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1160 augroup END |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1161 endfunc |
5a0d5f8e1778
patch 8.1.2017: cannot execute commands after closing the cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1162 |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1163 func Test_verbosefile() |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1164 set verbosefile=Xlog |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1165 echomsg 'foo' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1166 echomsg 'bar' |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1167 set verbosefile= |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1168 let log = readfile('Xlog') |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1169 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
|
1170 call delete('Xlog') |
20120
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1171 call mkdir('Xdir') |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21140
diff
changeset
|
1172 call assert_fails('set verbosefile=Xdir', ['E484:.*Xdir', 'E474:']) |
20120
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1173 call delete('Xdir', 'd') |
11323
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1174 endfunc |
3e799a37ea22
patch 8.0.0547: extra line break in verbosefile
Christian Brabandt <cb@256bit.org>
parents:
11279
diff
changeset
|
1175 |
18297
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1176 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
|
1177 CheckScreendump |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1178 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1179 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
|
1180 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
|
1181 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
|
1182 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
|
1183 [SCRIPT] |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1184 call writefile(lines, 'XTest_verbose') |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1185 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1186 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
|
1187 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
|
1188 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
|
1189 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
|
1190 |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1191 " 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
|
1192 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
|
1193 call delete('XTest_verbose') |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1194 endfunc |
b0b37bd807ba
patch 8.1.2143: cannot see each command even when 'verbose' is set
Bram Moolenaar <Bram@vim.org>
parents:
18084
diff
changeset
|
1195 |
13890
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1196 func Test_setcmdpos() |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1197 func InsertTextAtPos(text, pos) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1198 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
|
1199 return a:text |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1200 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1201 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1202 " 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
|
1203 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
|
1204 call assert_equal('"1ab2', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1205 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1206 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
|
1207 call assert_equal('"1b2a', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1208 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1209 " 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
|
1210 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
|
1211 call assert_equal('"12ab', @:) |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1212 |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1213 " 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
|
1214 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
|
1215 endfunc |
3aac8d62351c
patch 8.0.1816: no test for setcmdpos()
Christian Brabandt <cb@256bit.org>
parents:
13831
diff
changeset
|
1216 |
15320
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1217 func Test_cmdline_overstrike() |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1218 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
|
1219 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
|
1220 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1221 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
|
1222 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
|
1223 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1224 " 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
|
1225 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
|
1226 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
|
1227 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1228 " 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
|
1229 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
|
1230 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
|
1231 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1232 " 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
|
1233 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
|
1234 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
|
1235 endfor |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1236 |
15607
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1237 " Test overstrike with multi-byte characters. |
2dcaa860e3fc
patch 8.1.0811: too many #ifdefs
Bram Moolenaar <Bram@vim.org>
parents:
15320
diff
changeset
|
1238 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
|
1239 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
|
1240 |
de8dc397cd2a
patch 8.1.0668: no test for overstrike mode in the command line
Bram Moolenaar <Bram@vim.org>
parents:
14417
diff
changeset
|
1241 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
|
1242 endfunc |
18084
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1243 |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1244 func Test_cmdwin_bug() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1245 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1246 |
18084
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1247 let winid = win_getid() |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1248 sp |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1249 try |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1250 call feedkeys("q::call win_gotoid(" .. winid .. ")\<CR>:q\<CR>", 'x!') |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1251 catch /^Vim\%((\a\+)\)\=:E11/ |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1252 endtry |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1253 bw! |
f4b51934d4f8
patch 8.1.2037: can call win_gotoid() in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
18043
diff
changeset
|
1254 endfunc |
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
|
1255 |
18467
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1256 func Test_cmdwin_restore() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1257 CheckFeature cmdwin |
18467
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1258 CheckScreendump |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1259 |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1260 let lines =<< trim [SCRIPT] |
26153
44fe7d15881d
patch 8.2.3608: users who type "q:" instead of ":q" are confused
Bram Moolenaar <Bram@vim.org>
parents:
26032
diff
changeset
|
1261 augroup vimHints | au! | augroup END |
18467
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1262 call setline(1, range(30)) |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1263 2split |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1264 [SCRIPT] |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1265 call writefile(lines, 'XTest_restore') |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1266 |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1267 let buf = RunVimInTerminal('-S XTest_restore', {'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
|
1268 call TermWait(buf, 50) |
18467
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1269 call term_sendkeys(buf, "q:") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1270 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1271 |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1272 " normal restore |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1273 call term_sendkeys(buf, ":q\<CR>") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1274 call VerifyScreenDump(buf, 'Test_cmdwin_restore_2', {}) |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1275 |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1276 " restore after setting 'lines' with one window |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1277 call term_sendkeys(buf, ":close\<CR>") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1278 call term_sendkeys(buf, "q:") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1279 call term_sendkeys(buf, ":set lines=18\<CR>") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1280 call term_sendkeys(buf, ":q\<CR>") |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1281 call VerifyScreenDump(buf, 'Test_cmdwin_restore_3', {}) |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1282 |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1283 " clean up |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1284 call StopVimInTerminal(buf) |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1285 call delete('XTest_restore') |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1286 endfunc |
99fc29219b3e
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Bram Moolenaar <Bram@vim.org>
parents:
18463
diff
changeset
|
1287 |
24739
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1288 func Test_cmdwin_no_terminal() |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1289 CheckFeature cmdwin |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1290 CheckFeature terminal |
24743
a2a789bffa9c
patch 8.2.2910: test for cmdline window and terminal fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
24739
diff
changeset
|
1291 CheckNotMSWindows |
24739
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1292 |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1293 let buf = RunVimInTerminal('', {'rows': 12}) |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1294 call TermWait(buf, 50) |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1295 call term_sendkeys(buf, ":set cmdheight=2\<CR>") |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1296 call term_sendkeys(buf, "q:") |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1297 call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 1})\<CR>") |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1298 call VerifyScreenDump(buf, 'Test_cmdwin_no_terminal', {}) |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1299 call term_sendkeys(buf, ":q\<CR>") |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1300 call StopVimInTerminal(buf) |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1301 endfunc |
68e3adbeaf20
patch 8.2.2908: crash when using a terminal popup window from cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
24697
diff
changeset
|
1302 |
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
|
1303 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
|
1304 " 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
|
1305 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
|
1306 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
|
1307 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
|
1308 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
|
1309 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
|
1310 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
|
1311 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
|
1312 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
|
1313 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
|
1314 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
|
1315 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
|
1316 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1317 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
|
1318 \ 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
|
1319 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1320 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
|
1321 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
|
1322 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1323 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
|
1324 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
|
1325 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
|
1326 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
|
1327 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
|
1328 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
|
1329 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
|
1330 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
|
1331 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1332 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
|
1333 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
|
1334 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
|
1335 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
|
1336 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
|
1337 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
|
1338 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
|
1339 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
|
1340 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1341 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
|
1342 |
18d7337b6837
patch 8.1.2225: the "last used" info of a buffer is under used
Bram Moolenaar <Bram@vim.org>
parents:
18297
diff
changeset
|
1343 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
|
1344 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
|
1345 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
|
1346 endfunc |
18793
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1347 |
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1348 func Test_cmdwin_feedkeys() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1349 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1350 |
18793
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1351 " This should not generate E488 |
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1352 call feedkeys("q:\<CR>", 'x') |
19625
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1353 " Using feedkeys with q: only should automatically close the cmd window |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1354 call feedkeys('q:', 'xt') |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1355 call assert_equal(1, winnr('$')) |
f70a3c1000bb
patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
19613
diff
changeset
|
1356 call assert_equal('', getcmdwintype()) |
18793
7a1606ceec7d
patch 8.1.2385: opening cmdline window with feedkeys() does not work
Bram Moolenaar <Bram@vim.org>
parents:
18713
diff
changeset
|
1357 endfunc |
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
|
1358 |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1359 " Tests for the issues fixed in 7.4.441. |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1360 " When 'cedit' is set to Ctrl-C, opening the command window hangs Vim |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1361 func Test_cmdwin_cedit() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1362 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1363 |
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
|
1364 exe "set cedit=\<C-c>" |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1365 normal! : |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1366 call assert_equal(1, winnr('$')) |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1367 |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1368 let g:cmd_wintype = '' |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1369 func CmdWinType() |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1370 let g:cmd_wintype = getcmdwintype() |
19398
f0033a10b613
patch 8.2.0257: cannot recognize a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1371 let g:wintype = win_gettype() |
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
|
1372 return '' |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1373 endfunc |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1374 |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1375 call feedkeys("\<C-c>a\<C-R>=CmdWinType()\<CR>\<CR>") |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1376 echo input('') |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1377 call assert_equal('@', g:cmd_wintype) |
19398
f0033a10b613
patch 8.2.0257: cannot recognize a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1378 call assert_equal('command', g:wintype) |
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
|
1379 |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1380 set cedit&vim |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1381 delfunc CmdWinType |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1382 endfunc |
2d41b63f52de
patch 8.1.2390: test94 is old style, fix 7.4.441 not tested
Bram Moolenaar <Bram@vim.org>
parents:
18793
diff
changeset
|
1383 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1384 " Test for CmdwinEnter autocmd |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1385 func Test_cmdwin_autocmd() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1386 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1387 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1388 augroup CmdWin |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1389 au! |
23784
34a95c4bd647
patch 8.2.2433: opening cmdline window gives error in BufLeave autocommand
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
1390 autocmd BufLeave * if &buftype == '' | update | endif |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1391 autocmd CmdwinEnter * startinsert |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1392 augroup END |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1393 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1394 call assert_fails('call feedkeys("q:xyz\<CR>", "xt")', 'E492:') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1395 call assert_equal('xyz', @:) |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1396 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1397 augroup CmdWin |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1398 au! |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1399 augroup END |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1400 augroup! CmdWin |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1401 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1402 |
19143
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1403 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
|
1404 CheckScreendump |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1405 |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1406 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
|
1407 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
|
1408 [SCRIPT] |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1409 |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1410 call writefile(lines, 'XtestCmdlineClearTabenter') |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1411 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
|
1412 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
|
1413 " 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
|
1414 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
|
1415 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
|
1416 |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1417 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
|
1418 call delete('XtestCmdlineClearTabenter') |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1419 endfunc |
bfcafd1a3e37
patch 8.2.0131: command line is not cleared when switching tabs
Bram Moolenaar <Bram@vim.org>
parents:
18981
diff
changeset
|
1420 |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1421 " 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
|
1422 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
|
1423 %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
|
1424 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
|
1425 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
|
1426 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
|
1427 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
|
1428 |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1429 call writefile([], 'Xfile.cpp') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1430 call writefile([], 'Xfile.java') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1431 new Xfile.cpp |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1432 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
|
1433 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
|
1434 close |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1435 call delete('Xfile.cpp') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1436 call delete('Xfile.java') |
19370
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1437 endfunc |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19143
diff
changeset
|
1438 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1439 func Test_cmdwin_jump_to_win() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1440 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1441 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1442 call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:') |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1443 new |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1444 set modified |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21140
diff
changeset
|
1445 call assert_fails('call feedkeys("q/:qall\<CR>", "xt")', ['E37:', 'E162:']) |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1446 close! |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1447 call feedkeys("q/:close\<CR>", "xt") |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1448 call assert_equal(1, winnr('$')) |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1449 call feedkeys("q/:exit\<CR>", "xt") |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1450 call assert_equal(1, winnr('$')) |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1451 |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1452 " opening command window twice should fail |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1453 call assert_beeps('call feedkeys("q:q:\<CR>\<CR>", "xt")') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1454 call assert_equal(1, winnr('$')) |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1455 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1456 |
20717
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1457 func Test_cmdwin_interrupted() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1458 CheckFeature cmdwin |
20717
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1459 CheckScreendump |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1460 |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1461 " aborting the :smile output caused the cmdline window to use the current |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1462 " buffer. |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1463 let lines =<< trim [SCRIPT] |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1464 au WinNew * smile |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1465 [SCRIPT] |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1466 call writefile(lines, 'XTest_cmdwin') |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1467 |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1468 let buf = RunVimInTerminal('-S XTest_cmdwin', {'rows': 18}) |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1469 " open cmdwin |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1470 call term_sendkeys(buf, "q:") |
20741
fa6f1c97813f
patch 8.2.0923: cmdline test is slow
Bram Moolenaar <Bram@vim.org>
parents:
20737
diff
changeset
|
1471 call WaitForAssert({-> assert_match('-- More --', term_getline(buf, 18))}) |
20717
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1472 " quit more prompt for :smile command |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1473 call term_sendkeys(buf, "q") |
20741
fa6f1c97813f
patch 8.2.0923: cmdline test is slow
Bram Moolenaar <Bram@vim.org>
parents:
20737
diff
changeset
|
1474 call WaitForAssert({-> assert_match('^$', term_getline(buf, 18))}) |
20717
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1475 " execute a simple command |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1476 call term_sendkeys(buf, "aecho 'done'\<CR>") |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1477 call VerifyScreenDump(buf, 'Test_cmdwin_interrupted', {}) |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1478 |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1479 " clean up |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1480 call StopVimInTerminal(buf) |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1481 call delete('XTest_cmdwin') |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1482 endfunc |
abebcc20af26
patch 8.2.0911: crash when opening a buffer for the cmdline window fails
Bram Moolenaar <Bram@vim.org>
parents:
20703
diff
changeset
|
1483 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1484 " 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
|
1485 func Test_cmd_backtick() |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1486 %argd |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1487 argadd `=['a', 'b', 'c']` |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1488 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
|
1489 %argd |
25617
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1490 |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1491 argadd `echo abc def` |
28f1b7c38ba1
patch 8.2.3345: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
25601
diff
changeset
|
1492 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
|
1493 %argd |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1494 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19398
diff
changeset
|
1495 |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1496 " Test for the :! command |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1497 func Test_cmd_bang() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
1498 CheckUnix |
19471
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1499 |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1500 let lines =<< trim [SCRIPT] |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1501 " 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
|
1502 call assert_fails('!!', 'E34:') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1503 set nomore |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1504 " 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
|
1505 call setline(1, 'foo!') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1506 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
|
1507 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
|
1508 " 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
|
1509 silent !echo \! ! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1510 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
|
1511 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
|
1512 call delete('Xfile.out') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1513 qall! |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1514 [SCRIPT] |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1515 call writefile(lines, 'Xscript') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1516 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
|
1517 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
|
1518 endif |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1519 call delete('Xscript') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1520 call delete('Xresult') |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1521 endfunc |
cb73f4ae6b7c
patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
1522 |
20703
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1523 " 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
|
1524 func Test_cmd_bang_E135() |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1525 new |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1526 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
|
1527 augroup test_cmd_filter_E135 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1528 au! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1529 autocmd FilterReadPost * help |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1530 augroup END |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1531 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
|
1532 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1533 augroup test_cmd_filter_E135 |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1534 au! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1535 augroup END |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1536 %bwipe! |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1537 endfunc |
ce55e65d7e41
patch 8.2.0905: test coverage could be better
Bram Moolenaar <Bram@vim.org>
parents:
20185
diff
changeset
|
1538 |
19517
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1539 " 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
|
1540 func Test_cmdline_expand_home() |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1541 call mkdir('Xdir') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1542 call writefile([], 'Xdir/Xfile1') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1543 call writefile([], 'Xdir/Xfile2') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1544 cd Xdir |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1545 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
|
1546 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
|
1547 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
|
1548 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
|
1549 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
|
1550 cd .. |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1551 call delete('Xdir', 'rf') |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1552 endfunc |
738a4fe2c8c5
patch 8.2.0316: ex_getln.c code has insufficient test coverage
Bram Moolenaar <Bram@vim.org>
parents:
19471
diff
changeset
|
1553 |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1554 " 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
|
1555 " 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
|
1556 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
|
1557 new |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1558 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
|
1559 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
|
1560 " 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
|
1561 " insert mode |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1562 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
|
1563 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
|
1564 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
|
1565 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1566 " 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
|
1567 " 'insertmode' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1568 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
|
1569 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
|
1570 close! |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1571 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1572 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1573 " Test for 'wildmode' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1574 func Test_wildmode() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1575 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
|
1576 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
|
1577 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1578 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
|
1579 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1580 func SaveScreenLine() |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1581 let g:Sline = Screenline(&lines - 1) |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1582 return '' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1583 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1584 cnoremap <expr> <F2> SaveScreenLine() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1585 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1586 set nowildmenu |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1587 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
|
1588 let g:Sline = '' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1589 call feedkeys(":MyCmd \t\t\<F2>\<C-B>\"\<CR>", 'xt') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1590 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
|
1591 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
|
1592 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1593 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
|
1594 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
|
1595 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
|
1596 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
|
1597 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
|
1598 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1599 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
|
1600 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
|
1601 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
|
1602 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1603 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
|
1604 let g:Sline = '' |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1605 call feedkeys(":MyCmd \t\<F2>\<C-B>\"\<CR>", 'xt') |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1606 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
|
1607 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
|
1608 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1609 set wildmode="" |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1610 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
|
1611 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
|
1612 |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1613 " 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
|
1614 set wildmode=longest |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1615 set fileignorecase |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19679
diff
changeset
|
1616 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
|
1617 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
|
1618 call assert_equal('"buffer AAA', @:) |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1619 set fileignorecase& |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1620 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1621 " 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
|
1622 set wildmode=list |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1623 let g:Sline = '' |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1624 call feedkeys(":b A\t\t\<F2>\<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
|
1625 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
|
1626 call assert_equal('"b A', @:) |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1627 |
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1628 %argdelete |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1629 delcommand MyCmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1630 delfunc T |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1631 delfunc SaveScreenLine |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1632 cunmap <F2> |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1633 set wildmode& |
19679
9199f34d838e
patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19625
diff
changeset
|
1634 %bwipe! |
19536
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1635 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1636 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1637 " 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
|
1638 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
|
1639 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
|
1640 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
|
1641 call interrupt() |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1642 return |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1643 endif |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1644 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
|
1645 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1646 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
|
1647 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1648 set nowildmenu |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1649 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
|
1650 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
|
1651 try |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1652 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
|
1653 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
|
1654 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
|
1655 endtry |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1656 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
|
1657 |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1658 delcommand Tcmd |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1659 delfunc F |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1660 set wildmode& |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1661 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1662 |
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
|
1663 " 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
|
1664 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
|
1665 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
|
1666 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
|
1667 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
|
1668 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
|
1669 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
|
1670 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
|
1671 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
|
1672 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
|
1673 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
|
1674 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
|
1675 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
|
1676 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
|
1677 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
|
1678 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1679 " 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
|
1680 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
|
1681 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
|
1682 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
|
1683 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
|
1684 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
|
1685 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
|
1686 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
|
1687 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
|
1688 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
|
1689 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
|
1690 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
|
1691 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
|
1692 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
|
1693 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
|
1694 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
|
1695 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
|
1696 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
|
1697 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
|
1698 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
|
1699 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1700 " 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
|
1701 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
|
1702 " 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
|
1703 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
|
1704 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
|
1705 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1706 " 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
|
1707 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
|
1708 |
b3ef3538b389
patch 8.2.0332: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19536
diff
changeset
|
1709 " 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
|
1710 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
|
1711 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
|
1712 endfunc |
bab20768e1fd
patch 8.2.0325: ex_getln.c code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19517
diff
changeset
|
1713 |
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
|
1714 " 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
|
1715 " 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
|
1716 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
|
1717 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
|
1718 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
|
1719 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
|
1720 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1721 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
|
1722 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
|
1723 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
|
1724 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
|
1725 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
|
1726 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
|
1727 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
|
1728 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
|
1729 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1730 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
|
1731 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
|
1732 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
|
1733 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
|
1734 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
|
1735 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
|
1736 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
|
1737 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
|
1738 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
|
1739 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
|
1740 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
|
1741 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
|
1742 |
43c04edcafec
patch 8.2.0342: some code in ex_getln.c not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19556
diff
changeset
|
1743 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
|
1744 %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
|
1745 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
|
1746 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1747 " Test for recursively getting multiple command line inputs |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1748 func Test_cmdwin_multi_input() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1749 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1750 |
19581
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1751 call feedkeys(":\<C-R>=input('P: ')\<CR>\"cyan\<CR>\<CR>", 'xt') |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1752 call assert_equal('"cyan', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1753 endfunc |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1754 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1755 " 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
|
1756 func Test_cmdline_revins() |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1757 CheckNotMSWindows |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1758 CheckFeature rightleft |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1759 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
|
1760 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
|
1761 set allowrevins |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1762 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
|
1763 call assert_equal('"abcñèæ', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1764 set allowrevins& |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1765 endfunc |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1766 |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1767 " 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
|
1768 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
|
1769 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
|
1770 call assert_equal('"ゔ', @:) |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1771 endfunc |
848dc460adf0
patch 8.2.0347: various code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19570
diff
changeset
|
1772 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1773 " Test for normal mode commands not supported in the cmd window |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1774 func Test_cmdwin_blocked_commands() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1775 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1776 |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1777 call assert_fails('call feedkeys("q:\<C-T>\<CR>", "xt")', 'E11:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1778 call assert_fails('call feedkeys("q:\<C-]>\<CR>", "xt")', 'E11:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1779 call assert_fails('call feedkeys("q:\<C-^>\<CR>", "xt")', 'E11:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1780 call assert_fails('call feedkeys("q:Q\<CR>", "xt")', 'E11:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1781 call assert_fails('call feedkeys("q:Z\<CR>", "xt")', 'E11:') |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1782 call assert_fails('call feedkeys("q:\<F1>\<CR>", "xt")', 'E11:') |
20747
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1783 call assert_fails('call feedkeys("q:\<C-W>s\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1784 call assert_fails('call feedkeys("q:\<C-W>v\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1785 call assert_fails('call feedkeys("q:\<C-W>^\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1786 call assert_fails('call feedkeys("q:\<C-W>n\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1787 call assert_fails('call feedkeys("q:\<C-W>z\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1788 call assert_fails('call feedkeys("q:\<C-W>o\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1789 call assert_fails('call feedkeys("q:\<C-W>w\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1790 call assert_fails('call feedkeys("q:\<C-W>j\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1791 call assert_fails('call feedkeys("q:\<C-W>k\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1792 call assert_fails('call feedkeys("q:\<C-W>h\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1793 call assert_fails('call feedkeys("q:\<C-W>l\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1794 call assert_fails('call feedkeys("q:\<C-W>T\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1795 call assert_fails('call feedkeys("q:\<C-W>x\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1796 call assert_fails('call feedkeys("q:\<C-W>r\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1797 call assert_fails('call feedkeys("q:\<C-W>R\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1798 call assert_fails('call feedkeys("q:\<C-W>K\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1799 call assert_fails('call feedkeys("q:\<C-W>}\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1800 call assert_fails('call feedkeys("q:\<C-W>]\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1801 call assert_fails('call feedkeys("q:\<C-W>f\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1802 call assert_fails('call feedkeys("q:\<C-W>d\<CR>", "xt")', 'E11:') |
32f24b8c9c2d
patch 8.2.0926: cmdline test fails on Appveyor
Bram Moolenaar <Bram@vim.org>
parents:
20745
diff
changeset
|
1803 call assert_fails('call feedkeys("q:\<C-W>g\<CR>", "xt")', 'E11:') |
19613
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1804 endfunc |
9c15be376631
patch 8.2.0363: some Normal mode commands not tested
Bram Moolenaar <Bram@vim.org>
parents:
19581
diff
changeset
|
1805 |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1806 " Close the Cmd-line window in insert mode using CTRL-C |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1807 func Test_cmdwin_insert_mode_close() |
23748
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1808 CheckFeature cmdwin |
93f90f2ff4e9
patch 8.2.2415: no way to check for the cmdwin feature
Bram Moolenaar <Bram@vim.org>
parents:
23598
diff
changeset
|
1809 |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1810 %bw! |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1811 let s = '' |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1812 exe "normal q:a\<C-C>let s='Hello'\<CR>" |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1813 call assert_equal('Hello', s) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1814 call assert_equal(1, winnr('$')) |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1815 endfunc |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
1816 |
20185
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
1817 " 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
|
1818 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
|
1819 new |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
1820 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
|
1821 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
|
1822 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
|
1823 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
|
1824 q! |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
1825 endfunc |
0610f1ddb3a0
patch 8.2.0648: semicolon search does not work in first line
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
1826 |
20911
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1827 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
|
1828 CheckUnix |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1829 if executable('ls') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1830 " 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
|
1831 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
|
1832 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
|
1833 endif |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1834 |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1835 if executable('rm') |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1836 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
|
1837 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
|
1838 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
|
1839 |
f86140ad0164
patch 8.2.1121: command completion not working after ++arg
Bram Moolenaar <Bram@vim.org>
parents:
21052
diff
changeset
|
1840 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
|
1841 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
|
1842 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
|
1843 endif |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1844 endfunc |
b4835adf384e
patch 8.2.1007: completion doesn't work after ":r ++arg !"
Bram Moolenaar <Bram@vim.org>
parents:
20873
diff
changeset
|
1845 |
22967
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1846 " 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
|
1847 func Test_wildmenu_dirstack() |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1848 CheckUnix |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1849 %bw! |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1850 call mkdir('Xdir1/dir2/dir3', 'p') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1851 call writefile([], 'Xdir1/file1_1.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1852 call writefile([], 'Xdir1/file1_2.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1853 call writefile([], 'Xdir1/dir2/file2_1.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1854 call writefile([], 'Xdir1/dir2/file2_2.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1855 call writefile([], 'Xdir1/dir2/dir3/file3_1.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1856 call writefile([], 'Xdir1/dir2/dir3/file3_2.txt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1857 cd Xdir1/dir2/dir3 |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1858 set wildmenu |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1859 |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1860 call feedkeys(":e \<Tab>\<C-B>\"\<CR>", 'xt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1861 call assert_equal('"e file3_1.txt', @:) |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1862 call feedkeys(":e \<Tab>\<Up>\<C-B>\"\<CR>", 'xt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1863 call assert_equal('"e ../dir3/', @:) |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1864 call feedkeys(":e \<Tab>\<Up>\<Up>\<C-B>\"\<CR>", 'xt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1865 call assert_equal('"e ../../dir2/', @:) |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1866 call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<C-B>\"\<CR>", 'xt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1867 call assert_equal('"e ../../dir2/dir3/', @:) |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1868 call feedkeys(":e \<Tab>\<Up>\<Up>\<Down>\<Down>\<C-B>\"\<CR>", 'xt') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1869 call assert_equal('"e ../../dir2/dir3/file3_1.txt', @:) |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1870 |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1871 cd - |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1872 call delete('Xdir1', 'rf') |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1873 set wildmenu& |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1874 endfunc |
47a5349168ea
patch 8.2.2030: some tests fail on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22510
diff
changeset
|
1875 |
24622
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1876 " Test for recalling newer or older cmdline from history with <Up>, <Down>, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1877 " <S-Up>, <S-Down>, <PageUp>, <PageDown>, <C-p>, or <C-n>. |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1878 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
|
1879 CheckFeature cmdline_hist |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1880 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1881 let g:cmdlines = [] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1882 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
|
1883 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1884 let histories = [ |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1885 \ {'name': 'cmd', 'enter': ':', 'exit': "\<Esc>"}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1886 \ {'name': 'search', 'enter': '/', 'exit': "\<Esc>"}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1887 \ {'name': 'expr', 'enter': ":\<C-r>=", 'exit': "\<Esc>\<Esc>"}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1888 \ {'name': 'input', 'enter': ":call input('')\<CR>", 'exit': "\<CR>"}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1889 "\ TODO: {'name': 'debug', ...} |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1890 \] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1891 let keypairs = [ |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1892 \ {'older': "\<Up>", 'newer': "\<Down>", 'prefixmatch': v:true}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1893 \ {'older': "\<S-Up>", 'newer': "\<S-Down>", 'prefixmatch': v:false}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1894 \ {'older': "\<PageUp>", 'newer': "\<PageDown>", 'prefixmatch': v:false}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1895 \ {'older': "\<C-p>", 'newer': "\<C-n>", 'prefixmatch': v:false}, |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1896 \] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1897 let prefix = 'vi' |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1898 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
|
1899 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
|
1900 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
|
1901 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
|
1902 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
|
1903 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
|
1904 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
|
1905 let g:cmdlines = [] |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1906 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
|
1907 \ .. prefix |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1908 \ .. 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
|
1909 \ .. 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
|
1910 \ .. h.exit |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1911 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
|
1912 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
|
1913 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
|
1914 \ ? ['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
|
1915 \ : ['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
|
1916 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
|
1917 endfor |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1918 endfor |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1919 |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1920 unlet g:cmdlines |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1921 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
|
1922 endfunc |
ae44ab8824dd
patch 8.2.2850: recalling commands from history is not tested
Bram Moolenaar <Bram@vim.org>
parents:
24256
diff
changeset
|
1923 |
24624
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1924 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
|
1925 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
|
1926 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
|
1927 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
|
1928 autocmd! |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1929 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
|
1930 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
|
1931 |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1932 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
|
1933 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
|
1934 |
24663
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
1935 let @b = 'b' |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
1936 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
|
1937 let g:log = [] |
ce7a80bd0fd5
patch 8.2.2870: CmdlineChange event triggered twice for CTRL-R
Bram Moolenaar <Bram@vim.org>
parents:
24624
diff
changeset
|
1938 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
|
1939 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
|
1940 |
24624
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1941 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
|
1942 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
|
1943 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
|
1944 autocmd! |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1945 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
|
1946 endfunc |
c6aaf1742634
patch 8.2.2851: using <Cmd> mapping on the command line triggers CmdlineChanged
Bram Moolenaar <Bram@vim.org>
parents:
24622
diff
changeset
|
1947 |
24669
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1948 " 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
|
1949 func Test_suffixes_opt() |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1950 call writefile([], 'Xfile') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1951 call writefile([], 'Xfile.c') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1952 call writefile([], 'Xfile.o') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1953 set suffixes= |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1954 call feedkeys(":e Xfi*\<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
|
1955 call assert_equal('"e Xfile Xfile.c Xfile.o', @:) |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1956 set suffixes=.c |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1957 call feedkeys(":e Xfi*\<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
|
1958 call assert_equal('"e Xfile Xfile.o Xfile.c', @:) |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1959 set suffixes=,, |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1960 call feedkeys(":e Xfi*\<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
|
1961 call assert_equal('"e Xfile.c Xfile.o Xfile', @:) |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1962 set suffixes& |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1963 call delete('Xfile') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1964 call delete('Xfile.c') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1965 call delete('Xfile.o') |
d7644bffe128
patch 8.2.2873: not enough tests for writing buffers
Bram Moolenaar <Bram@vim.org>
parents:
24663
diff
changeset
|
1966 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
|
1967 |
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
|
1968 " vim: shiftwidth=2 sts=2 expandtab |