NvChad / base46

NvChad's base46 theme plugin with caching ( Total re-write )
Other
182 stars 191 forks source link

Treesitter's capture not highlighted #331

Closed LorenzoGuideri closed 1 month ago

LorenzoGuideri commented 1 month ago

I'm writing my custom theme: some tags work effectively, others won't. I'm editing a python file. my code is pretty simple:

M.polish_hl = { ["@repeat"] = { fg = M.base_16.base0E }, }

This should make the "for" purple, but it doesn't. It says it's "cleared" I know for sure it's not a Treesitter problem, since :lua vim.api.nvim_set_hl(0, "@repeat", { fg = "#000000", italic = true, bold = true,}) works perfectly.

image image

LorenzoGuideri commented 1 month ago

The theme, for reference


local M = {}

M.base_30 = {
  white = "#f5f4f1",
  darker_black = "#222222", -- nvtree bg
  black = "#272727",        -- selected tab, fzf bg
  black2 = "#2f2f2f",       -- top line bg
  one_bg = "#363731",       -- real bg of onedark
  one_bg2 = "#3E3F39",
  one_bg3 = "#464741",      -- fzf border
  grey = "#4D4E48",
  grey_fg = "#74705d",      -- comments, nvtree arrows
  grey_fg2 = "#5D5E58",
  light_grey = "#64655F",
  red = "#e36d76",
  baby_pink = "#f98385",
  pink = "#f36d76",
  line = "#363942", -- for lines like vertsplit
  green = "#96c367",
  vibrant_green = "#99c366",
  nord_blue = "#90c0e0", -- bottom line LSP, selected tab bg
  blue = "#51afef",
  yellow = "#e6c181",
  sun = "#e7db74",
  purple = "#c885d7",
  dark_purple = "#b26fc1",
  teal = "#34bfd0",
  orange = "#d39467",
  cyan = "#41afef",
  statusline_bg = "#303030", -- bottom line bg
  lightbg = "#3E3F39",       -- bottom line details bg
  pmenu_bg = "#99c366",
  folder_bg = "#61afef",     -- folder name color
}

M.base_16 = {
  base00 = "#272727", -- background
  base01 = "#383830",
  base02 = "#49483e",
  base03 = "#75715e", -- unused
  base04 = "#a59f85",
  base05 = "#f8f8f2", -- text
  base06 = "#f5f4f1",
  base07 = "#f9f8f5",
  base08 = "#fd9621",
  base09 = "#ac80ff", -- find result bg
  base0A = "#f4bf75",
  base0B = "#a6e22c",
  base0C = "#a1efe4",
  base0D = "#67d8ef",
  base0E = "#f92472",
  base0F = "#cc6633",
}

M.polish_hl = {
  -- #fd9621
  ["@parameter"] = { fg = M.base_16.base08, italic = true },
  ["@constructor"] = { fg = M.base_16.base08 },
  ["Type"] = { fg = M.base_16.base08 },

  -- #67d8ef
  ["@keyword.function"] = { fg = M.base_16.base0D, italic = true },
  ["@type.builtin"] = { fg = M.base_16.base0D, italic = true },

  -- #a6e22c
  ["@function"] = { fg = M.base_16.base0B },

  -- #e7db74
  ["@string"] = { fg = M.base_30.sun, italic = true },

  -- #ac80ff
  ["@boolean"] = { fg = M.base_16.base09 },

  -- #f8f8f2
  ["@punctuation.bracket"] = { fg = M.base_16.base05 },
  ["@punctuation.delimiter"] = { fg = M.base_16.base05 },
  ["@variable"] = { fg = M.base_16.base05 },

  -- #f92472
  ["@include"] = { fg = M.base_16.base0E },
  ["@repeat"] = { fg = M.base_16.base0E },
  ["@operator"] = { fg = M.base_16.base0E },
  ["@attribute"] = { fg = M.base_16.base0E },
  ["@conditional"] = { fg = M.base_16.base0E },
  ["@exception"] = { fg = M.base_16.base0E },

}

M.type = "dark"

M = require("base46").override_theme(M, "griso")

return M
siduck commented 1 month ago

seems like there's no repeat in our treesitter

siduck commented 1 month ago

image

also your polish_hl structure is wrong.