Skip to content

Commit 4aad6f8

Browse files
committed
fix: do not load snacks.image if not enabled (#2411)
1 parent 6bb2a26 commit 4aad6f8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lua/fzf-lua/previewer/builtin.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ end
10551055
function Previewer.base:attach_snacks_image_buf(buf, entry)
10561056
---@diagnostic disable-next-line: undefined-field
10571057
local simg = self.snacks_image.enabled and (_G.Snacks or {}).image
1058-
if not simg or not simg.supports(entry.path) then
1058+
if not simg or not simg.config.enabled or not simg.supports(entry.path) then
10591059
return false
10601060
end
10611061
simg.buf.attach(buf, { src = entry.path })
@@ -1067,6 +1067,7 @@ function Previewer.base:attach_snacks_image_inline()
10671067
local simg = (_G.Snacks or {}).image
10681068
local bufnr, preview_winid = self.preview_bufnr, self.win.preview_winid
10691069
if not simg
1070+
or not simg.config.enabled
10701071
or not self.snacks_image.enabled
10711072
or not self.snacks_image.render_inline
10721073
or vim.b[bufnr].snacks_image_attached then

0 commit comments

Comments
 (0)