summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/internal.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/builtin/internal.lua')
-rw-r--r--lua/telescope/builtin/internal.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua
index 99cc296..122827f 100644
--- a/lua/telescope/builtin/internal.lua
+++ b/lua/telescope/builtin/internal.lua
@@ -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)(),