mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
vim-patch:8.2.3141: no error when using :complete for :command without -nargs
Problem: No error when using :complete for :command without -nargs. Solution: Give an error. (Martin Tournoij, closes vim/vim#8544, closes vim/vim#8541)de69a7353e
N/A patches for version.c: vim-patch:8.1.1801: cannot build without the +eval feature Problem: Cannot build without the +eval feature. Solution: Always define funcexe_T.505e43a20e
vim-patch:8.1.1818: unused variable Problem: Unused variable. Solution: Remove the variable. (Mike Williams)b4a88a0441
vim-patch:8.2.1464: Vim9: build warning for unused variable Problem: Vim9: build warning for unused variable. Solution: Delete the variable declaration.829ac868b7
vim-patch:8.2.2639: build failure when fsync() is not available Problem: Build failure when fsync() is not available. Solution: Add #ifdef.5ea79a2599
vim-patch:8.2.2814: Vim9: unused variable Problem: Vim9: unused variable. (John Marriott) Solution: Adjust #ifdef.b06b50dfa0
vim-patch:8.2.2947: build failure without the channel feature Problem: Build failure without the channel feature. Solution: Add back #ifdef. (John Marriott)f5bfa8faa7
vim-patch:8.2.2976: build failure without the +eval feature Problem: Build failure without the +eval feature. Solution: Add #ifdefs.8de901e1f1
vim-patch:8.2.2986: build failure without the profile feature Problem: Build failure without the profile feature. Solution: Add #ifdef.d9f31c13d2
vim-patch:8.2.3114: Amiga-like systems: build error using stat() Problem: Amiga-like systems: build error using stat(). Solution: Only build swapfile_process_running() on systems where it is actually used. (Ola Söder, closes vim/vim#8519)599a6e5b36
This commit is contained in:
@@ -238,6 +238,8 @@ func Test_CmdErrors()
|
||||
call assert_fails('com! -complete=custom DoCmd :', 'E467:')
|
||||
call assert_fails('com! -complete=customlist DoCmd :', 'E467:')
|
||||
call assert_fails('com! -complete=behave,CustomComplete DoCmd :', 'E468:')
|
||||
call assert_fails('com! -complete=file DoCmd :', 'E1208:')
|
||||
call assert_fails('com! -nargs=0 -complete=file DoCmd :', 'E1208:')
|
||||
call assert_fails('com! -nargs=x DoCmd :', 'E176:')
|
||||
call assert_fails('com! -count=1 -count=2 DoCmd :', 'E177:')
|
||||
call assert_fails('com! -count=x DoCmd :', 'E178:')
|
||||
@@ -306,27 +308,33 @@ func Test_CmdCompletion()
|
||||
call feedkeys(":com DoC\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"com DoC', @:)
|
||||
|
||||
com! -complete=behave DoCmd :
|
||||
com! -nargs=1 -complete=behave DoCmd :
|
||||
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"DoCmd mswin xterm', @:)
|
||||
|
||||
" This does not work. Why?
|
||||
"call feedkeys(":DoCmd x\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
"call assert_equal('"DoCmd xterm', @:)
|
||||
|
||||
com! -complete=custom,CustomComplete DoCmd :
|
||||
com! -nargs=* -complete=custom,CustomComplete DoCmd :
|
||||
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"DoCmd January February Mars', @:)
|
||||
|
||||
com! -complete=customlist,CustomCompleteList DoCmd :
|
||||
com! -nargs=? -complete=customlist,CustomCompleteList DoCmd :
|
||||
call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"DoCmd Monday Tuesday Wednesday', @:)
|
||||
|
||||
com! -complete=custom,CustomCompleteList DoCmd :
|
||||
com! -nargs=+ -complete=custom,CustomCompleteList DoCmd :
|
||||
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E730:')
|
||||
|
||||
com! -complete=customlist,CustomComp DoCmd :
|
||||
com! -nargs=+ -complete=customlist,CustomComp DoCmd :
|
||||
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:')
|
||||
|
||||
" custom completion without a function
|
||||
com! -nargs=? -complete=custom, DoCmd
|
||||
call assert_beeps("call feedkeys(':DoCmd \t', 'tx')")
|
||||
|
||||
" custom completion failure with the wrong function
|
||||
com! -nargs=? -complete=custom,min DoCmd
|
||||
call assert_fails("call feedkeys(':DoCmd \t', 'tx')", 'E118:')
|
||||
|
||||
delcom DoCmd
|
||||
endfunc
|
||||
|
||||
func CallExecute(A, L, P)
|
||||
@@ -459,21 +467,21 @@ func Test_command_list()
|
||||
\ execute('command DoCmd'))
|
||||
|
||||
" Test with various -complete= argument values (non-exhaustive list)
|
||||
command! -complete=arglist DoCmd :
|
||||
command! -nargs=1 -complete=arglist DoCmd :
|
||||
call assert_equal("\n Name Args Address Complete Definition"
|
||||
\ .. "\n DoCmd 0 arglist :",
|
||||
\ .. "\n DoCmd 1 arglist :",
|
||||
\ execute('command DoCmd'))
|
||||
command! -complete=augroup DoCmd :
|
||||
command! -nargs=* -complete=augroup DoCmd :
|
||||
call assert_equal("\n Name Args Address Complete Definition"
|
||||
\ .. "\n DoCmd 0 augroup :",
|
||||
\ .. "\n DoCmd * augroup :",
|
||||
\ execute('command DoCmd'))
|
||||
command! -complete=custom,CustomComplete DoCmd :
|
||||
command! -nargs=? -complete=custom,CustomComplete DoCmd :
|
||||
call assert_equal("\n Name Args Address Complete Definition"
|
||||
\ .. "\n DoCmd 0 custom :",
|
||||
\ .. "\n DoCmd ? custom :",
|
||||
\ execute('command DoCmd'))
|
||||
command! -complete=customlist,CustomComplete DoCmd :
|
||||
command! -nargs=+ -complete=customlist,CustomComplete DoCmd :
|
||||
call assert_equal("\n Name Args Address Complete Definition"
|
||||
\ .. "\n DoCmd 0 customlist :",
|
||||
\ .. "\n DoCmd + customlist :",
|
||||
\ execute('command DoCmd'))
|
||||
|
||||
" Test with various -narg= argument values.
|
||||
|
Reference in New Issue
Block a user