Skip to content

refactor(theme): color definitions to use vim.g directly#143

Merged
MindTooth merged 1 commit intosrcery-colors:masterfrom
NopAngel:master
Apr 18, 2026
Merged

refactor(theme): color definitions to use vim.g directly#143
MindTooth merged 1 commit intosrcery-colors:masterfrom
NopAngel:master

Conversation

@NopAngel
Copy link
Copy Markdown
Contributor

Changes

Performance: Replaced vim.api.nvim_eval calls with vim.g for faster and more idiomatic access to global variables.

Robustness: Added fallback logic for specific Srcery colors (orange, hardblack, etc.) to ensure the theme doesn't break if certain globals are missing.

Code Quality: Cleaned up redundant section definitions by using local variables (DRY principle).

Formatting: Followed the project's comment style and structure.

@roosta
Copy link
Copy Markdown
Member

roosta commented Apr 17, 2026

Hi there, thanks for opening a PR, this looks good, no need to call eval when we already have the globals. Thoughts @MindTooth? Im good with a merge.

@MindTooth
Copy link
Copy Markdown
Member

If this speeds up, I am all in.

is this something that we can extend to more languages? Don’t have to do that now

@roosta
Copy link
Copy Markdown
Member

roosta commented Apr 17, 2026

there are no other eval calls in codebase that I can find, but there are places where we can replace srcery#helper#GetColor with global variables. In the lightline theme for example. I've already made that change in the next branch (modernize)

@roosta
Copy link
Copy Markdown
Member

roosta commented Apr 17, 2026

Whats going on with the linter check here? Seems it never runs on external PRs like this, is it suppose to? Should I just bypass it?

@MindTooth
Copy link
Copy Markdown
Member

I will check pipeline tonight. Maybe $default-branch is not a valid parameter.

@roosta
Copy link
Copy Markdown
Member

roosta commented Apr 17, 2026

here's what I did to fix the lint job on feat/modernize 9ce323f we should probably backport that fix, I'll just rebase atop the master when its done.
EDIT: Vimjas/vint#394

@MindTooth MindTooth merged commit aeb1d31 into srcery-colors:master Apr 18, 2026
1 check failed
@MindTooth
Copy link
Copy Markdown
Member

I just merged it should be good.

Thanks! ❤️

roosta added a commit that referenced this pull request Apr 18, 2026
These plugins haven't worked in this branch for a while, the old memoize
groups are no more. Fix some atrocious formatting as well in the airline
theme, think this one's been through a few formatters.

Note: lastest master contained fixes for lualine which I resolved here

Refs:
#143
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.

3 participants