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

Theme Toml not allowing Bare keys #10509

Closed
Conando025 opened this issue Apr 18, 2024 · 1 comment
Closed

Theme Toml not allowing Bare keys #10509

Conando025 opened this issue Apr 18, 2024 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@Conando025
Copy link

Summary

When writing a theme using bare keys / table names leads to malfunction.
The spec says that

Best practice is to use bare keys except when absolutely necessary.

Reproduction Steps

I tried this:

  1. create the file ~/.config/helix/theme/broken.tomlwith the following content
[ui.selection]
bg = "black"
  1. open helix and type :theme broken

I expected this to happen:

It loads my theme as it would if it was

["ui.selection"]
bg = "black"

Also

# Works
"ui.selection" = { bg = "black" }
# Broken
ui.selection = { bg = "black" }

Instead, this happened:
It refused to load my theme as ui.selection is missing.

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

alacritty 0.12.2

Installation Method

apt

Helix Version

helix 24.3 (2cadec0)

@Conando025 Conando025 added the C-bug Category: This is a bug label Apr 18, 2024
@the-mikedavis
Copy link
Member

This is the intended behavior. We use . for fallback behavior - ui.statusline.inactive falls back to ui.statusline if not defined, and that falls back to ui if not defined. That conflicts with TOML using it for nesting keys so you need to quote your theme keys. In the long run we will switch away from TOML for config including themes (#10389) so we won't be changing how the theme keys work for the sake of TOML

@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants