summaryrefslogtreecommitdiff
path: root/lua/telescope/actions.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-02 00:06:03 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-02 00:06:07 -0400
commit061307233cdff0a90504117dd48e4fec3a10443a (patch)
treed71cd84a3eb93fda55284b22be3eb610aaced13a /lua/telescope/actions.lua
parent9f906f03922907b95b71a8f57254e64ba9c76ce8 (diff)
feat: add some new items and make mappings easier
Diffstat (limited to 'lua/telescope/actions.lua')
-rw-r--r--lua/telescope/actions.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/telescope/actions.lua b/lua/telescope/actions.lua
index abd5bf8..f1b4a38 100644
--- a/lua/telescope/actions.lua
+++ b/lua/telescope/actions.lua
@@ -78,5 +78,23 @@ actions.close = function(prompt_bufnr)
vim.cmd(string.format([[bwipeout! %s]], prompt_bufnr))
end
+actions.set_command_line = function(prompt_bufnr)
+ local entry = actions.get_selected_entry(prompt_bufnr)
+
+ actions.close(prompt_bufnr)
+
+ vim.cmd(entry.value)
+end
+
+-- TODO: Think about how to do this.
+actions.insert_value = function(prompt_bufnr)
+ local entry = actions.get_selected_entry(prompt_bufnr)
+
+ vim.schedule(function()
+ actions.close(prompt_bufnr)
+ end)
+
+ return entry.value
+end
return actions