mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker): only show extmark errors when debug is enabled. Closes #988
This commit is contained in:
parent
5af04ab667
commit
f6d9af7410
2 changed files with 3 additions and 8 deletions
|
@ -399,6 +399,7 @@ local defaults = {
|
|||
explorer = false, -- show explorer debug info
|
||||
files = false, -- show file debug info
|
||||
grep = false, -- show file debug info
|
||||
extmarks = false, -- show extmarks errors
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -524,14 +524,8 @@ function M:_render(item, row)
|
|||
extmark.row = nil
|
||||
extmark.field = nil
|
||||
local ok, err = pcall(vim.api.nvim_buf_set_extmark, self.win.buf, ns, row - 1, col, extmark)
|
||||
if not ok then
|
||||
Snacks.notify.error(
|
||||
"Failed to set extmark. This should not happen. Please report.\n"
|
||||
.. err
|
||||
.. "\n```lua\n"
|
||||
.. vim.inspect(extmark)
|
||||
.. "\n```"
|
||||
)
|
||||
if not ok and self.picker.opts.debug.extmarks then
|
||||
Snacks.notify.error("Failed to set extmark.\n" .. err .. "\n```lua\n" .. vim.inspect(extmark) .. "\n```")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue