config: migrate the display section to registry bindings#364
Merged
Conversation
The display section kept its keys in both the legacy config_options[] table and the CREG registry, with hand-written display_sync_to/from_runtime hooks copying between them. config set wrote the struct field directly via the legacy table, so a user's `config set display.X` was re-seeded the next time a mode preset applied -- it never reached the registry's SESSION layer. Bind the eight dual-table display keys (syntax_highlighting, autosuggestions, transient_prompt, theme_hot_reload, optimization_level, and the three lle.pager.* keys) to their runtime cells and remove their legacy rows, so the registry is the sole writer: config set, TOML, and per-mode defaults route through the registry and write-through to the struct via the binding. A config set on a display key -- and the display lle ... builtins, which already set the registry -- now lands in the SESSION layer and survives a mode switch. The display_sync_to/from_runtime hooks are deleted and the section's hooks set to NULL. performance_monitoring and ambiguous_width stay legacy-only for now; neither is synced, so neither had the clobber. Verified: config set display.transient_prompt false survives a lush -> bash -> lush round-trip; mode defaults still resolve (lush on, bash/zsh/posix off); config show display lists every key. 156/156 tests.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The display section kept its keys in both the legacy
config_options[]table and the CREG registry, with hand-written
display_sync_to/from_runtimehooks copying between them.
config setwrote the struct field directly viathe legacy table, so a user's
config set display.Xwas re-seeded the nexttime a mode preset applied — it never reached the registry's SESSION layer.
This binds the eight dual-table display keys to their runtime cells and
removes their legacy rows, making the registry the sole writer:
display.syntax_highlighting,display.autosuggestions,display.transient_prompt,display.theme_hot_reload,display.optimization_level,display.lle.pager.{enabled,min_lines,wrap_search}config set, TOML load, and per-mode defaults now route through the registryand write-through to the struct via the binding. A
config seton a displaykey — and the
display lle …builtins, which already set the registry — nowlands in the SESSION layer and survives a mode switch (the previous
behavior re-seeded the user's value on the next mode preset).
display_sync_to/from_runtimeare deleted and the section's hooks set toNULL.display.performance_monitoringanddisplay.ambiguous_widthstaylegacy-only for now — neither is synced, so neither had the clobber; they are
their own migrate/wire backlog items.
Verified live:
config set display.transient_prompt falsesurvives alush → bash → lush round-trip; the per-mode defaults still resolve (lush on,
bash/zsh/posix off);
config show displaylists every key. Clean under-Werror; 156/156 tests.