WIP: Actually get the UI to work and add some tests

This commit is contained in:
TJ DeVries
2020-08-20 23:41:53 -04:00
parent 96cac0a8c8
commit cfddae42f5
9 changed files with 270 additions and 146 deletions

View File

@@ -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