A bug in FuzzyCommand
Closed this issue · 1 comments
zhixiao-zhang commented
FuzzyCommand only works with user-defined commands. When executed with built-in commands, such as quit, it results in an error message.
The problem is caused by these two lines:
var info = split(execute(':filter /\<' .. command .. '\>/ command ' .. command), '\n')[-1]
var nargs = split(matchstr(info, '\<' .. command .. '\>\s\+\S'), '\s\+')[-1]Refer to the help doc of command:
:com[mand] :com :command
List all user-defined commands.
When a built-in command is passed to it, it will return '', which leading to an out-of-range error. I'm not sure how to fix this, as vim doesn't provide a command-like cmd for built-in ones.
mmrwoods commented
Thanks for reporting and explaining clearly, fixed by handling user-defined and built-in commands separately