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/finders.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lua/telescope/finders.lua') diff --git a/lua/telescope/finders.lua b/lua/telescope/finders.lua index b3c5022..56b823b 100644 --- a/lua/telescope/finders.lua +++ b/lua/telescope/finders.lua @@ -155,6 +155,24 @@ end -- } -- end +finders.new_job = function(command_generator) + return finders.new { + fn_command = function(_, prompt) + local command_list = command_generator(prompt) + if command_list == nil then + return nil + end + + local command = table.remove(command_list, 1) + + return { + command = command, + args = command_list, + } + end + } +end + finders.new_oneshot_job = function(command_list, entry_maker) command_list = vim.deepcopy(command_list) -- cgit v1.2.3