Repository navigation
fix(colors): keep the number format when resetting colors - #682
Merged
sirmalloc merged 1 commit intoOct 9, 2026
Merged
Conversation
Edit Colors' (r)eset and (c)lear all removed each widget's numberFormat along with its colors, bold and dim. Precision used to be cycled from Edit Colors, but it moved to Edit Lines (the `.` key), and the reset paths kept clearing it. So resetting a widget's colors silently undid its number style: a Context Length set to whole numbers went from `Ctx: 19k` back to `Ctx: 18.6k`, though neither the key help nor the clear-all confirmation mentions anything but colors. Reset and clear all now remove only color, background, bold and dim.
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.
What
Edit Colors'
(r)esetand(c)lear allnow reset only colors, bold and dim. A widget's number style (set with.in Edit Lines, ordecimalsin settings.json) stays.Why
Number styles started out in Edit Colors (#456's first commit cycled them with
nthere) and the two reset paths were extended to clear them too. Later in the same PR the cycle moved to Edit Lines ("The color menu goes back to color, bold and dim only"), but reset and clear all kept removingnumberFormat.So resetting a widget's colors also undid its number style, with nothing on screen saying so: the key help just says
(r)esetin a colors menu, and the clear-all confirmation says "This will reset all colors for all widgets to their defaults." With Context Length set to whole numbers, Edit Colors → ↓ to Context Length →r: the preview goes fromCtx: 19ktoCtx: 18.6k, and after ctrl+s the widget is saved as{"id": "3", "type": "context-length"}, with itsnumberFormatgone.How
resetWidgetStylingandclearAllWidgetStylingno longer listnumberFormatamong the fields they remove. They still removecolor,backgroundColor,boldanddimas before. Widgets without a number style are unaffected, and the global number format in Global Overrides was never touched by these keys.Demo
Context Length set to whole numbers (the preview's sample data,
19k), then Edit Colors → Context Length →r. Before, the number goes back to18.6kalong with the color; after, only the color resets.Powerline: before
Powerline: after
Plain: before
Plain: after
Testing
color-menu/__tests__/mutations.test.tsasserted thatnumberFormatwas removed; they now expect it kept, alongside the color, bold and dim removal they already checked. Both failed before the fix.bun test: 2782 pass, 0 fail.bun run lintpasses.mainshowsCtx: 18.6kafterrand saves the widget withoutnumberFormat; this branch keepsCtx: 19kand saves"numberFormat": {"style": "whole"}, with the color reset to the default (Bright Black) on both.