Skip to content

Commit

Permalink
fix: check for ft in markdown autocommands
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd committed Jun 29, 2023
1 parent c891ad8 commit 9aa67f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/image/integrations/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ local setup_autocommands = function(ctx)
"WinResized",
}, {
group = group,
callback = function()
callback = function(args)
if vim.bo[args.buf].filetype ~= "markdown" then return end
render(ctx)
end,
})
Expand All @@ -107,7 +108,8 @@ local setup_autocommands = function(ctx)
"TextChangedI",
}, {
group = group,
callback = function()
callback = function(args)
if vim.bo[args.buf].filetype ~= "markdown" then return end
local current_window = vim.api.nvim_get_current_win()
local images = ctx.api.get_images({ window = current_window })
for _, image in ipairs(images) do
Expand Down

0 comments on commit 9aa67f6

Please sign in to comment.