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

colorschemes/base16: add settings + refactor to fix #1675 #1676

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Jun 11, 2024

Removed the enum restriction on the colorscheme option, allowing anything to be passed through, including raw lua. This fixes #1675

Settings

Added support for the plugin's "advanced" config settings and simplified the extraConfig implementation.

As some of their API is undocumented, I've opened RRethy/base16-nvim#102. Should we wait for acknowledgement?

Enum

Previously, we listed all builtin base16 colorschemes in theme-list.nix, however this means we have to maintain that list, ensuring it tracks any upstream changes.

Also worth noting that upstream don't always have their docs up to date. I've opened a PR to hopefully address this: RRethy/base16-nvim#103.

Having a ~240 value enum type wasn't particularly readable though, anyway...

Current documentation (screenshot)

image

Refactor

I've cleaned up some of the implementation. In particular, I found a more readable way to define customColorschemeType using stringToCharacters and genAttrs mapAttrs on the example attrs.

Rename

EDIT: this section is irrelevant now that we know the lua API (setup) doesn't use the base16- prefix.

Details

I toyed with renaming the option to colors to match upstream's internal name, and to allow automatically apply the prefix to be done only when the old name was used.
In the end I decided the rename wasn't worth it. Let me know if you disagree.

@MattSturgeon MattSturgeon force-pushed the base16 branch 2 times, most recently from cf2add6 to 2782fa7 Compare June 12, 2024 17:37
@MattSturgeon MattSturgeon marked this pull request as ready for review June 12, 2024 19:16
@MattSturgeon MattSturgeon requested review from GaetanLepage and a team June 12, 2024 19:17
@MattSturgeon MattSturgeon changed the title colorschemes/base16: update options + add settings colorschemes/base16: add settings + refactor to fix #1675 Jun 12, 2024
@MattSturgeon
Copy link
Member Author

vimPackages/start/base16-nvim/lua/base16-colorscheme.lua:705: module 'colors.base16-gruvbox-dark-hard' not found:

Turns out the base16- prefix only applies when using the vimscript api (:colorscheme), the lua implementation has no prefix.

This is good, because we don't need any new warnings or changed behaviour!

@MattSturgeon MattSturgeon force-pushed the base16 branch 2 times, most recently from 802d21c to c9dd15b Compare June 12, 2024 20:10
Copy link
Member Author

@MattSturgeon MattSturgeon Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theme-list is probably still too long for the docs. Feel free to suggest more removals.

Copy link
Member

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is looking good !
Sorry for taking so long...

@MattSturgeon

This comment was marked as outdated.

This comment was marked as outdated.

@MattSturgeon

This comment was marked as outdated.

This comment was marked as outdated.

@MattSturgeon

This comment was marked as outdated.

This comment was marked as outdated.

@MattSturgeon

This comment was marked as outdated.

This comment was marked as outdated.

@GaetanLepage

This comment was marked as outdated.

This comment was marked as outdated.

Added support for the plugin's "advanced" config settings.

Removed the enum restriction and prefix concatenation, allowing anything
to be passed through, including raw lua: fixes nix-community#1675

The theme list is now much shorter and is included directly in the option
description.

Some general cleanup, in particular to `extraConfig` and `customColorschemeType`.
@MattSturgeon
Copy link
Member Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Jul 8, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at c0ea106

@mergify mergify bot merged commit c0ea106 into nix-community:main Jul 8, 2024
73 checks passed
@mergify mergify bot temporarily deployed to github-pages July 8, 2024 09:50 Inactive
@MattSturgeon MattSturgeon deleted the base16 branch July 8, 2024 09:54
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.

[BUG] List of available base16 colorschemes is not up to date
2 participants