mirror of
https://github.com/neovim/neovim.git
synced 2026-08-14 19:39:33 +00:00
fix(dir): do not swallow errors raised after the list callback
Problem: An error raised after the list handler ran (e.g. while
rendering) unwinds through the pcall around provider.list()
and is routed back into the now no-op handler: silently
discarded.
Solution: Re-raise the error when the handler has already run.
This commit is contained in:
@@ -268,6 +268,10 @@ function load(buf, name, provider, restore_view, setup, select)
|
||||
|
||||
local ok, call_err = pcall(provider.list, buf, name, on_list) ---@type boolean, any
|
||||
if not ok then
|
||||
if done then
|
||||
-- The handler already ran and would ignore this error: propagate it.
|
||||
error(call_err, 0)
|
||||
end
|
||||
-- Route provider exceptions through the list handler so failures share one cleanup path.
|
||||
on_list(tostring(call_err), nil)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user