feat: support for builtin.commands to show buffer commands (#1889)
This commit is contained in:
@@ -318,6 +318,15 @@ internal.commands = function(opts)
|
||||
table.insert(commands, cmd)
|
||||
end
|
||||
|
||||
local need_buf_command = vim.F.if_nil(opts.show_buf_command, true)
|
||||
|
||||
if need_buf_command then
|
||||
local buf_command_iter = vim.api.nvim_buf_get_commands(0, {})
|
||||
buf_command_iter[true] = nil -- remove the redundant entry
|
||||
for _, cmd in pairs(buf_command_iter) do
|
||||
table.insert(commands, cmd)
|
||||
end
|
||||
end
|
||||
return commands
|
||||
end)(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user