API: nvim_get_commands(): builtin is irrelevant for buffer-local

builtin commands are never buffer-local, so we can return empty for that
case.
This commit is contained in:
Justin M. Keyes
2018-05-11 20:59:53 +02:00
parent 738bffea2c
commit cb6672853a
2 changed files with 17 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ describe('nvim_get_commands', function()
end)
it('validates input', function()
expect_err('builtin commands not supported yet', meths.get_commands,
expect_err('builtin=true not implemented', meths.get_commands,
{builtin=true})
expect_err('unexpected key: foo', meths.get_commands,
{foo='blah'})
@@ -47,6 +47,9 @@ describe('nvim_get_commands', function()
-- Delete a command.
command('delcommand Pwd')
eq({cmd_dict}, curbufmeths.get_commands({builtin=false}))
-- {builtin=true} always returns empty for buffer-local case.
eq({}, curbufmeths.get_commands({builtin=true}))
end)
it('gets various command attributes', function()