Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting for R Code Blocks in qmd-Files Breaks After Changing Color Scheme with Telescope #122

Open
gwbrck opened this issue Jul 30, 2024 · 1 comment

Comments

@gwbrck
Copy link

gwbrck commented Jul 30, 2024

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
Copy link
Author

gwbrck commented Sep 13, 2024

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,
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant