Skip to content

Conversation

@john-mutuma
Copy link
Owner

What does this PR do?

This PR refactors the highlight customization modules for Glance, LazyGit, and NvimTree to use a consistent getter function (get()) for returning highlight specifications. The previous approach of exporting a static M.highlights table is replaced with a get() function, allowing for more dynamic and maintainable highlight definitions. All plugin setup code is updated to use the new getter function when applying highlights.

Changes made in this PR:

  • Converted M.highlights tables to M.get() functions in:
    • plugins/customizations/highlights/glance.lua
    • plugins/customizations/highlights/lazygit.lua
    • plugins/customizations/highlights/nvim-tree.lua
  • Updated plugin modules to use the new get function:
    • plugins/lsp/glance.lua
    • plugins/lazygit.lua
    • plugins/nvim-tree.lua

Why is it needed?

  • Ensures a consistent and extensible pattern for highlight definitions across custom modules.
  • Allows highlight groups to be computed dynamically if needed (e.g., based on colorscheme or background).
  • Simplifies highlight application logic in plugin setup code.
  • Improves maintainability and readability of highlight customization code.

How have the changes been tested?

  • Manually verified that highlights are correctly applied for Glance, LazyGit, and NvimTree after the refactor.
  • Checked that no errors occur during plugin initialization and highlight application.
  • Confirmed that highlight overrides respond correctly to colorscheme/background changes.

Screenshots (if applicable)

N/A

Checklist

  • Refactored highlight modules to use get() function
  • Updated all plugin setup code to use new getter
  • Verified highlight application works as expected
  • Code is consistent and maintainable
  • PR description and title follow project conventions

Refactored highlight customization modules for Glance, LazyGit, and
NvimTree to use a consistent `get()` function for returning highlight
specs, replacing the previous `M.highlights` table pattern. Updated
plugin setup code to use the new getter function for applying
highlights.

Changes:
- Converted `M.highlights` tables to `M.get()` functions in:
  - highlights/glance.lua
  - highlights/lazygit.lua
  - highlights/nvim-tree.lua
- Updated plugin modules to use the new `get` function:
  - plugins/lsp/glance.lua
  - plugins/lazygit.lua
  - plugins/nvim-tree.lua

This improves consistency, enables dynamic highlight computation, and
simplifies highlight application logic.
@john-mutuma john-mutuma merged commit 6d618c2 into develop May 27, 2025
@john-mutuma john-mutuma deleted the user/johnmutuma/continous-improvements branch May 27, 2025 20:28
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

Successfully merging this pull request may close these issues.

2 participants