Skip to content

Commit

Permalink
feat: make it possible to disable warnings when searching (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoKatel authored Oct 22, 2021
1 parent 808a2e5 commit 9983edc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/todo-comments/search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function M.search(cb, opts)
opts = opts or {}
opts.cwd = opts.cwd or "."
opts.cwd = vim.fn.fnamemodify(opts.cwd, ":p")
opts.disable_not_found_warnings = opts.disable_not_found_warnings or false
if not Config.loaded then
Util.error("todo-comments isn't loaded. Did you run setup()?")
return
Expand Down Expand Up @@ -62,7 +63,7 @@ function M.search(cb, opts)
local error = table.concat(j:stderr_result(), "\n")
Util.error(command .. " failed with code " .. code .. "\n" .. error)
end
if code == 1 then
if code == 1 and opts.disable_not_found_warnings ~= true then
Util.warn("no todos found")
end
local lines = j:result()
Expand Down

0 comments on commit 9983edc

Please sign in to comment.