From cfddae42f59eacbd792a8853be089f4711bbf4ba Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Thu, 20 Aug 2020 23:41:53 -0400 Subject: WIP: Actually get the UI to work and add some tests --- lua/telescope/finders.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lua/telescope/finders.lua') diff --git a/lua/telescope/finders.lua b/lua/telescope/finders.lua index e5a601e..10716d0 100644 --- a/lua/telescope/finders.lua +++ b/lua/telescope/finders.lua @@ -29,6 +29,7 @@ function Finder:new(opts) -- list -- ... return setmetatable({ + results = opts.results, fn_command = opts.fn_command, static = opts.static, state = {}, @@ -46,6 +47,16 @@ end -- do_your_job -- process_plz function Finder:_find(prompt, process_result, process_complete) + if self.results then + assert(type(self.results) == 'table', "self.results must be a table") + for _, v in ipairs(self.results) do + process_result(v) + end + + process_complete() + return + end + if (self.state.job_id or 0) > 0 then vim.fn.jobstop(self.job_id) end -- cgit v1.2.3