diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-05-18 17:44:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-18 17:44:26 +0800 |
| commit | 7b46848f140285be586cc3946db6976bd6bed2a5 (patch) | |
| tree | 3ba2b991720f4b82a09698d9e02b3b6532b1c4d0 /test/functional/lua/luaeval_spec.lua | |
| parent | 3ffe29d679b2a4aee5a2f6fd9eee4845c4fef0e5 (diff) | |
| download | rneovim-7b46848f140285be586cc3946db6976bd6bed2a5.tar.gz rneovim-7b46848f140285be586cc3946db6976bd6bed2a5.tar.bz2 rneovim-7b46848f140285be586cc3946db6976bd6bed2a5.zip | |
vim-patch:9.2.0494: User commands cannot handle single args with spaces (#39854)
Problem: User commands cannot handle single args with spaces
Solution: Add the -nargs=_ attribute (Maxim Kim)
-nargs=_ allow user commands to have a single argument with spaces.
For example given the following Test command and TestComplete function:
```
vim9script
def TestComplete(A: string, _: string, _: number): list<string>
var all = ["qqqq", "aaaa", "qq aa"]
return all->matchfuzzy(A)
enddef
command! -nargs=_ -complete=customlist,TestComplete Test echo <q-args>
```
`:Test q a<tab>` should successfully complete `qq aa`
fixes: vim/vim#20102
closes: vim/vim#20189
https://github.com/vim/vim/commit/f0e874a129a702457a383017b576eef1553f95d8
Co-authored-by: Maxim Kim <habamax@gmail.com>
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
0 files changed, 0 insertions, 0 deletions