From 061307233cdff0a90504117dd48e4fec3a10443a Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 2 Sep 2020 00:06:03 -0400 Subject: feat: add some new items and make mappings easier --- lua/telescope/actions.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lua/telescope/actions.lua') 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 -- cgit v1.2.3