AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.18k stars 240 forks source link

Highlights are overriding with `telescope-nvchad-theme` #833

Closed snikoletopoulos closed 6 months ago

snikoletopoulos commented 6 months ago

Checklist

Neovim version (nvim -v)

0.9.5 release

Operating system/version

macOS 14.4

Terminal/GUI

WezTerm

Describe the bug

When enabling NVChad telescope theme from AstroNvim Community and having custom unrelated highlights in astroui, the telescope highlights are overriden. Only when i remove my highlights is the theme applied

Steps to Reproduce

  1. Add NVChad telescope theme to community
  2. Add custom highlights to init different from the telescope, ex. Cmp

Expected behavior

The highlights should merge and both configs are applied

Screenshots

No response

Additional Context

No response

mehalter commented 6 months ago

Please provide some clearer steps for replication and some clear details on the actual behavior and expected behavior

mehalter commented 6 months ago

ah I see what you mean. I believe what you want to do is modify your configuration to play nicely with the telescope nvchad theme pack. Here is an example (assuming you have the telescope-nvchad-theme pack added:

return {
  "AstroNvim/astroui",
  opts = function(_, opts)
    local highlights_init = opts.highlights.init
    return require("astrocore").extend_tbl(opts, {
      highlights = {
        init = function()
          local highlights = type(highlights_init) == "function" and highlights_init() or highlights_init

          -- custom highlights building off of previously modified highlights
          highlights.Normal = { bg = "#ABCDEF" }

          return highlights
        end,
      },
    })
  end,
}
mehalter commented 6 months ago

Also I will move this issue to the AstroCommunity repo

snikoletopoulos commented 6 months ago

Yes thank you. It would be nicer if we didn't have to do all this. I'll continue discussion in the AstroCommunity repo.

mehalter commented 6 months ago

Yeah, limitations of full flexibility means sometimes there is extra syntax

snikoletopoulos commented 6 months ago

@mehalter I tried the code you showed me and it worked. But there is an error with the types and I get the following error. Should I open an issue in the astroui repo?

image

Also can you re-open the issue now that it is in the astrocommunity repo?

mehalter commented 6 months ago

No this isn't a problem with AstroUI or anything, this is just an issue of you having the wrong type annotation in your config. Check the docs here: https://docs.astronvim.com/configuration/lua_completion/