tokyonight.nvim icon indicating copy to clipboard operation
tokyonight.nvim copied to clipboard

fix(main): show italic in markdown

Open nshern opened this issue 1 year ago • 5 comments

show italic is markdown by changing @markup.emphais to @markup.italic for all theme variants

Fixes #481

nshern avatar Jan 22 '24 22:01 nshern

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

TheShonuff avatar Jan 24 '24 22:01 TheShonuff

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

Hi, you can simply fix it through the config. This is my config:

return {
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "tokyonight",
    },
  },
  {
    "folke/tokyonight.nvim",
    config = function()
      require("tokyonight").setup({
        style = "night",
        transparent = true,
        styles = { sidebars = "transparent", floats = "transparent" },
        on_highlights = function(hl)
          hl["@markup.italic.markdown_inline"] = { style = "italic" }
        end,
      })
    end,
  },
}

nshern avatar Jan 25 '24 20:01 nshern

This would be very helpful. I've switched over to making notes in markdown in nvim and was scratching my head for a few hours trying to figure out why italics wasn't working. I've manually added this line to the theme.lua in the interim but it's breaking updates. Thank you.

Hi, you can simply fix it through the config. This is my config:

return {
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "tokyonight",
    },
  },
  {
    "folke/tokyonight.nvim",
    config = function()
      require("tokyonight").setup({
        style = "night",
        transparent = true,
        styles = { sidebars = "transparent", floats = "transparent" },
        on_highlights = function(hl)
          hl["@markup.italic.markdown_inline"] = { style = "italic" }
        end,
      })
    end,
  },
}

Ah thank you! I was goofing it up by doing h1.["@markup.italic.markdown_inline"]

TheShonuff avatar Jan 26 '24 05:01 TheShonuff

Yeah, I reckon the recent nvim-treesitter overhaul broke this, as it used to work before. Would be good to see this merged, though I'm not sure doing the formatting tweaks in the same commit is a good idea. Might be why it hasn't been merged yet.

adrian5 avatar Feb 03 '24 05:02 adrian5

@folke Any chance to get his merged, at least the relevant change to theme.lua? If not, can you at least give some feedback?

The tree-sitter capture group indeed looks to be @markup.italic and that should fix the regression.

adrian5 avatar Mar 15 '24 13:03 adrian5

italics work in tokyonoght

folke avatar May 19 '24 07:05 folke

italics work in tokyonoght

Did you even bother to look at the above PR? I even made second one to simplify review. This issue has been pointed out months ago and the theme still sets the deprecated @markup.emphasis group. It never worked in nvim-0.9 without user overrides:

markdown

The just-released nvim-0.10 handles it, but doesn't render the change in this PR obsolete.

adrian5 avatar May 19 '24 13:05 adrian5