Skip to content

Commit 27ab1cf

Browse files
fix(images): manually load images with snacks in ftplugin
This will ensure that images area loaded even when Orgmode plugin is loaded after the Snacks is already in the rtp.
1 parent 72f23ee commit 27ab1cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ftplugin/org.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,9 @@ vim.b.undo_ftplugin = table.concat({
7171
'indentkeys<',
7272
'| unlet! b:org_tmp_edit_window',
7373
}, ' ')
74+
75+
-- Manually attach Snacks.image module to ensure that images are shown.
76+
-- Snacks usually handles this automatically, but if Orgmode plugin is loaded after Snacks, it will not pick it up.
77+
if vim.tbl_get(_G, 'Snacks', 'image', 'config', 'enabled') and vim.tbl_get(_G, 'Snacks', 'image', 'config', 'doc', 'enabled') then
78+
require('snacks.image.doc').attach(bufnr)
79+
end

0 commit comments

Comments
 (0)