Skip to content

Commit

Permalink
fix: ensure the filetype is set on lazy load
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmh committed Jan 4, 2025
1 parent ae83959 commit 464a74b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/mdx/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function M.setup()

-- Configure treesitter to use the markdown parser for mdx files
vim.treesitter.language.register("markdown", "mdx")

-- If the current buffer has the extension mdx, but not the newly create filetype, set it
if vim.endswith(vim.api.nvim_buf_get_name(0), ".mdx") and vim.o.filetype ~= "mdx" then
vim.o.filetype = "mdx"
end
end

return M

0 comments on commit 464a74b

Please sign in to comment.