Skip to content

Commit

Permalink
fix(utils.lua): handle missing language in code chunk by defaulting t…
Browse files Browse the repository at this point in the history
…o filetype
  • Loading branch information
PMassicotte committed Mar 4, 2025
1 parent d01384f commit 1dfc089
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/r/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function M.get_lang()
if vim.bo.filetype == "rhelp" then return get_rhelp_lang() end

local current_chunk = quarto.get_current_code_chunk(vim.api.nvim_get_current_buf())
if not current_chunk.lang then return vim.bo.filetype end

return current_chunk.lang
end

Expand Down

0 comments on commit 1dfc089

Please sign in to comment.