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

inherit does not work with base16_theme #5156

Closed
plewis110 opened this issue Dec 14, 2022 · 4 comments · Fixed by #5218
Closed

inherit does not work with base16_theme #5156

plewis110 opened this issue Dec 14, 2022 · 4 comments · Fixed by #5218
Labels
A-theme Area: Theme and appearence related C-bug Category: This is a bug

Comments

@plewis110
Copy link

plewis110 commented Dec 14, 2022

Summary

I'm following the docs guide and created a new theme file mytheme.toml and placed it at ~/.config/helix/themes/mytheme.toml:

# ~/.config/helix/themes/mytheme.toml
inherits = "base16_theme"

ui.virtual.ruler = { fg = "grey", bg = "grey" }

Running :theme mytheme in hx myfile.json results in this output:

Theme does not exist

I've tried running cargo xtask themelint ~/.config/helix/themes/mytheme but the output doesn't make sense since I expect the default theme to be correct:

/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.selection`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.selection.primary`
/home/user/.config/helix/themes/mytheme: `ui.selection` and `ui.selection.primary` cannot be equal
/home/user/.config/helix/themes/mytheme: missing `fg` for `ui.text`
/home/user/.config/helix/themes/mytheme: missing `bg` for `ui.background`
/home/user/.config/helix/themes/mytheme: missing `fg` and `bg` for `ui.statusline`
/home/user/.config/helix/themes/mytheme: missing `fg` and `bg` for `ui.statusline.inactive`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.statusline.normal`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.statusline.insert`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.statusline.select`
/home/user/.config/helix/themes/mytheme: `ui.statusline.normal` and `ui.statusline.insert` cannot be equal
/home/user/.config/helix/themes/mytheme: `ui.statusline.normal` and `ui.statusline.select` cannot be equal
/home/user/.config/helix/themes/mytheme: missing `bg` for `ui.cursorline.primary`
/home/user/.config/helix/themes/mytheme: missing `fg` for `ui.virtual.whitespace`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.virtual.indent-guide`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.virtual.ruler`
/home/user/.config/helix/themes/mytheme: missing `fg` and `bg` for `ui.menu`
/home/user/.config/helix/themes/mytheme: missing `fg` and `bg` for `ui.help`
/home/user/.config/helix/themes/mytheme: missing `bg` for `ui.popup`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.window`
/home/user/.config/helix/themes/mytheme: missing `bg` for `ui.cursor.primary`
/home/user/.config/helix/themes/mytheme: missing `fg` or `bg` for `ui.cursor.match`
Error: "/home/user/.config/helix/themes/mytheme has issues"

All I want is to change the default color of the rulers since it is set to an obnoxious red by default. I picked base16_theme as the inherits because it is the output of running :theme in the editor. I'm working on a clone of the repo from yesterday. Please see below for the exact git commit.

Reproduction Steps

I tried this:

  1. hx

I expected this to happen:

Instead, this happened:

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

Linux

Terminal Emulator

zsh 5.4.1 (x86_64-unknown-linux-gnu) running in tmux 3.3a

Helix Version

22.12-25-g0f2ae35a

@plewis110 plewis110 added the C-bug Category: This is a bug label Dec 14, 2022
@kirawi
Copy link
Member

kirawi commented Dec 15, 2022

Is your runtime linked correctly? Are you able to see the other themes in :theme?

@kirawi kirawi added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 15, 2022
@the-mikedavis
Copy link
Member

I can reproduce this. It looks like it's not currently possible to use the base16 or true-color default themes with inherits since their TOML doesn't end up in the runtime directory.

@the-mikedavis the-mikedavis added A-theme Area: Theme and appearence related and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 15, 2022
@plewis110
Copy link
Author

Is your runtime linked correctly? Are you able to see the other themes in :theme?

Yeah, all the themes are there and I can switch between them.

@hunterliao29
Copy link
Contributor

I can reproduce this. It looks like it's not currently possible to use the base16 or true-color default themes with inherits since their TOML doesn't end up in the runtime directory.

I opened a pull request that fix this issue by getting TOML from by byte array. but I am not sure if this is a good way to do it.
maybe just put copy of default themes in runtime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-theme Area: Theme and appearence related C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants