Skip to content

Commit de0fd4a

Browse files
phanenibhagwan
authored andcommitted
fix: show stacktrace on error
1 parent 3e2a34e commit de0fd4a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lua/fzf-lua/utils.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ function M.notify(lvl, ...)
185185
verbose = false,
186186
err = M.__HAS_NVIM_011 and lvl == vim.log.levels.ERROR and true or nil,
187187
}
188-
vim.api.nvim_echo(chunks, true, echo_opts)
188+
if _G.fzf_jobstart and #vim.api.nvim_list_uis() == 0 then
189+
local output = vim.tbl_map(function(chunk) return chunk[1] end, chunks)
190+
error(table.concat(output, ""))
191+
else
192+
vim.api.nvim_echo(chunks, true, echo_opts)
193+
end
189194
end
190195
if vim.in_fast_event() then
191196
vim.schedule(nvim_echo)

scripts/cli.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ _G.fzf_jobstart = function(cmd, opts)
6363
end))
6464
end
6565

66-
local cmd = "FzfLua " .. table.concat(_G.arg, " ")
67-
---@diagnostic disable-next-line: param-type-mismatch
68-
assert(pcall(vim.cmd, cmd), "wrong cmd: " .. cmd)
66+
require("fzf-lua.cmd").run_command(unpack(_G.arg))
6967

7068
while true do
7169
vim.wait(100)

0 commit comments

Comments
 (0)