Skip to content

Commit

Permalink
fix: only err on fzf|skim exit code 2 (closes #812)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jul 7, 2023
1 parent 9686569 commit d04bbd9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lua/fzf-lua/win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,10 @@ function FzfWin:check_exit_status(exit_code, fzf_bufnr)
-- 1 No match
-- 2 Error
-- 130 Interrupted with CTRL-C or ESC
if exit_code ~= 0 and exit_code ~= 130 then
if exit_code == 2 then
local lines = vim.api.nvim_buf_get_lines(self.fzf_bufnr, 0, 1, false)
-- the reason we're not ignoring error 1 is due
-- to skim returning 1 for unexpected arguments
-- only warn about there is an actual error msg
if exit_code ~= 1 or (lines and #lines[1] > 0) then
utils.warn(("fzf error %s: %s"):format(
exit_code or "<null>",
lines and #lines[1] > 0 and lines[1] or "<null>"))
end
utils.warn(string.format("fzf error %d: %s", exit_code,
lines and #lines[1] > 0 and lines[1] or "<null>"))
end
end

Expand Down

0 comments on commit d04bbd9

Please sign in to comment.