Syntax Highlighting for R Code Blocks in qmd-Files Breaks After Changing Color Scheme with Telescope
Opened this issue · 1 comments
gwbrck commented
I believe I might have found a bug that is not related to my configuration. It occurs even when I clone the bare repository on both the main and dev branches.
When I open a Quarto file with Vim, the syntax highlighting in the R code block works as expected. However, when I want to change the color scheme with Telescope, the code block is no longer highlighted correctly.
Can anyone confirm this?
gwbrck commented
I added autocommands to reset the filetype, and now syntax highlighting in Quarto code blocks works as expected.
vim.api.nvim_create_autocmd("OptionSet", {
pattern = "background",
callback = function()
local ft = vim.bo.filetype
vim.cmd("set filetype=" .. ft)
end,
})
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
local ft = vim.bo.filetype
vim.cmd("set filetype=" .. ft)
end,
})