feat: allow a callback to be called on on_lines update (for filtering tags from query text) (#455)

* allow a callback to be called on on_lines update

* .

* remove unused _filter_marker var

* nit: Move to table and implement 'close'

Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
This commit is contained in:
Senghan Bright
2021-01-28 22:39:05 +01:00
committed by GitHub
parent 5995a8be8f
commit 9d4670c748
2 changed files with 15 additions and 2 deletions

View File

@@ -11,6 +11,8 @@ local _callable_obj = function()
obj.__index = obj
obj.__call = function(t, ...) return t:_find(...) end
obj.close = function() end
return obj
end
@@ -33,7 +35,7 @@ local JobFinder = _callable_obj()
function JobFinder:new(opts)
opts = opts or {}
> assert(not opts.results, "`results` should be used with finder.new_table")
assert(not opts.results, "`results` should be used with finder.new_table")
assert(not opts.static, "`static` should be used with finder.new_oneshot_job")
local obj = setmetatable({