Refresh generated neovim config
This commit is contained in:
@ -65,25 +65,25 @@ function M.search(cb, opts)
|
||||
return
|
||||
end
|
||||
|
||||
local args =
|
||||
vim.tbl_flatten({ Config.options.search.args, Config.search_regex(keywords_filter(opts.keywords)), opts.cwd })
|
||||
Job
|
||||
:new({
|
||||
command = command,
|
||||
args = args,
|
||||
on_exit = vim.schedule_wrap(function(j, code)
|
||||
if code == 2 then
|
||||
local error = table.concat(j:stderr_result(), "\n")
|
||||
Util.error(command .. " failed with code " .. code .. "\n" .. error)
|
||||
end
|
||||
if code == 1 and opts.disable_not_found_warnings ~= true then
|
||||
Util.warn("no todos found")
|
||||
end
|
||||
local lines = j:result()
|
||||
cb(M.process(lines))
|
||||
end),
|
||||
})
|
||||
:start()
|
||||
local args = {}
|
||||
vim.list_extend(args, Config.options.search.args)
|
||||
vim.list_extend(args, { Config.search_regex(keywords_filter(opts.keywords)), opts.cwd })
|
||||
|
||||
Job:new({
|
||||
command = command,
|
||||
args = args,
|
||||
on_exit = vim.schedule_wrap(function(j, code)
|
||||
if code == 2 then
|
||||
local error = table.concat(j:stderr_result(), "\n")
|
||||
Util.error(command .. " failed with code " .. code .. "\n" .. error)
|
||||
end
|
||||
if code == 1 and opts.disable_not_found_warnings ~= true then
|
||||
Util.warn("no todos found")
|
||||
end
|
||||
local lines = j:result()
|
||||
cb(M.process(lines))
|
||||
end),
|
||||
}):start()
|
||||
end
|
||||
|
||||
local function parse_opts(opts)
|
||||
@ -106,7 +106,7 @@ end
|
||||
|
||||
function M.setlist(opts, use_loclist)
|
||||
opts = parse_opts(opts) or {}
|
||||
opts.open = (opts.open ~= nil and {opts.open} or {true})[1]
|
||||
opts.open = (opts.open ~= nil and { opts.open } or { true })[1]
|
||||
M.search(function(results)
|
||||
if use_loclist then
|
||||
vim.fn.setloclist(0, {}, " ", { title = "Todo", id = "$", items = results })
|
||||
|
||||
Reference in New Issue
Block a user