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

BUG: Custom colorscheme highlights are being overwritten by DapUI setup #275

Closed
dasupradyumna opened this issue May 9, 2023 · 1 comment

Comments

@dasupradyumna
Copy link
Contributor

dasupradyumna commented May 9, 2023

I'm currently in the process of writing a colorscheme plugin, and I am facing an issue where the highlight for any group in control_hl_groups that my plugin sets are ignored / overridden by the setup() method in config/highlights.lua.
Similar behavior has also been noted in #178.

I have 2 things to point out:

  1. Why is the background color for the control groups being taken from background of WinBar (or WinBarNC)? I think it makes more sense to inherit the background from Normal (or NormalNC).
  2. The two version branches in the method are not equivalent in their logic; the older <0.8 version branch sets the "default" highlight groups correctly, whereas the newer >=0.8 branch destructively sets highlight groups (read :h nvim_set_hl) instead of the defaults. This can be fixed by adding the appropriate option, and the API calls can also be updated to the newer nvim_get_hl method.

As an experiment, I have already made the above changes in a local copy of this repo and it fixes the issue. But if we can have a discussion about what else to do, I am more than happy to open a PR for this.
Cheers :)

dasupradyumna added a commit to dasupradyumna/nvim-dap-ui that referenced this issue May 18, 2023
  Highlights set by colorschemes are overwritten by `nvim-dap-ui` plugin
  in the `require("dapui.config").highlights.lua:setup()` method.
  Modified the method to set the defaults for highlight groups instead
  of overwriting previously set highlights (typically by colorschemes).
  Added a helper function to use the newer `nvim_get_hl` API function if
  NeoVim's version is atleast 0.9.
dasupradyumna added a commit to dasupradyumna/nvim-dap-ui that referenced this issue May 18, 2023
  Highlights set by colorschemes are overwritten by `nvim-dap-ui` plugin
  in the `require("dapui.config").highlights.lua:setup()` method.
  Modified the method to set the defaults for highlight groups instead
  of overwriting previously set highlights (typically by colorschemes).
  Added a helper function to use the newer `nvim_get_hl` API function if
  NeoVim's version is atleast 0.9.
@dasupradyumna
Copy link
Contributor Author

Resolved by #276.

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