Skip to content

Flickering background in Quarto cells #75

@andy941

Description

@andy941

Hi,
I love the plugin, it makes a pleasure to work with Quarto files (I use it mainly for data science at work). I have an annoying issue where the cells background is unset in random amount of lines when another highlight is on, or that is what my debugging got me to. See below an example of the type of flickering I get:
normal highlight
image
broken by Illuminate (see the two lemur_residuals)
image
These are actually very sudden and I am not sure what they are related to (cursor is on a white space, maybe the IndentBlankline plugin?):
image

All this flickers constantly while moving the cursor around but I can't figure out why exactly. My guess is that happens when something else sets a background inside the cell? Disabling VimIlluminate for example solves that specific type of flickering.

Changing colorscheme to a default one does not help.

My headlines.nvim config:

require("headlines").setup({
	quarto = {
		query = vim.treesitter.query.parse(
			"markdown",
			[[
        (atx_heading [
          (atx_h1_marker)
          (atx_h2_marker)
          (atx_h3_marker)
          (atx_h4_marker)
          (atx_h5_marker)
          (atx_h6_marker)
        ] @headline)

        (thematic_break) @dash

        (fenced_code_block) @codeblock

        (block_quote_marker) @quote
        (block_quote (paragraph (inline (block_continuation) @quote)))
        (block_quote (paragraph (block_continuation) @quote))
        (block_quote (block_continuation) @quote)
      ]]
		),
		headline_highlights = { "Headline" },
		bullet_highlights = {
			"@text.title.1.marker.markdown",
			"@text.title.2.marker.markdown",
			"@text.title.3.marker.markdown",
			"@text.title.4.marker.markdown",
			"@text.title.5.marker.markdown",
			"@text.title.6.marker.markdown",
		},
		treesitter_language = "markdown",
		bullets = { "", "", "", "" },
		codeblock_highlight = "CodeBlock",
		dash_highlight = "Dash",
		dash_string = "-",
		quote_highlight = "Quote",
		quote_string = "",
		fat_headlines = true,
		fat_headline_upper_string = "",
		fat_headline_lower_string = "🬂",
	},
})

The code in the pictures:

#| label: plotting
#| echo: true
#| output-location: slide
#| message: false
#| fig-align: center
#| fig-alt: "Scatter plot of predicted and residual values for the fitted linear model."
library(reticulate)
library(ggplot2)
lemur_residuals <- py$lemur_data_py
ggplot(
  data = lemur_residuals,
  mapping = aes(
    x = Predicted,
    y = Residuals
  )
) +
  geom_point(colour = "#2F4F4F") +
  geom_hline(
    yintercept = 0,
    colour = "red"
  ) +
  theme(
    panel.background = element_rect(
      fill = "#eaf2f2",
      colour = "#eaf2f2"
    ),
    plot.background = element_rect(
      fill = "#eaf2f2",
      colour = "#eaf2f2"
    )
  )

Do you have an idea on what is going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions