summaryrefslogtreecommitdiff
path: root/lua/telescope/finders.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/finders.lua
parent9f906f03922907b95b71a8f57254e64ba9c76ce8 (diff)
feat: add some new items and make mappings easier
Diffstat (limited to 'lua/telescope/finders.lua')
-rw-r--r--lua/telescope/finders.lua18
1 files changed, 18 insertions, 0 deletions
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)