summaryrefslogtreecommitdiff
path: root/lua/telescope/actions.lua
diff options
context:
space:
mode:
authorSimon Zeng <contact@simonzeng.com>2020-10-24 23:00:22 -0400
committerGitHub <noreply@github.com>2020-10-24 23:00:22 -0400
commit59ef37ded43a77a4c0f35be434f1ea72a407ce84 (patch)
tree80e5eef13694cd470c2a7f89b92d2fb3bf4d8976 /lua/telescope/actions.lua
parent5aa20f1f54e54d5b6d5cd66baafcabf02b917a22 (diff)
Add telescopes provider (#168)
Amendment: replace the old `builtin`
Diffstat (limited to 'lua/telescope/actions.lua')
-rw-r--r--lua/telescope/actions.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/telescope/actions.lua b/lua/telescope/actions.lua
index ebebbea..878ac0e 100644
--- a/lua/telescope/actions.lua
+++ b/lua/telescope/actions.lua
@@ -165,6 +165,15 @@ actions.set_command_line = function(prompt_bufnr)
vim.cmd(entry.value)
end
+actions.run_builtin = function(prompt_bufnr)
+ local entry = actions.get_selected_entry(prompt_bufnr)
+
+ actions.close(prompt_bufnr)
+ vim.cmd [[startinsert]]
+
+ require('telescope.builtin')[entry.text]()
+end
+
-- TODO: Think about how to do this.
actions.insert_value = function(prompt_bufnr)
local entry = actions.get_selected_entry(prompt_bufnr)