Repository navigation
Make std help honor color_config and fix vertical padding - #19621
Conversation
There was a problem hiding this comment.
Review overview
🟡 Changes recommended
Theme colors work for plain names, hex strings and {fg, attr} records, and the spacing is even on every page I checked. One kind of theme value sends help to man, and a few spots still don't match help.
Findings: 1
Open (5)
Notes from my clanker, checked on 42eb470. Built the branch and ran each case on it and on 0.117.1 (ca70639, current main). Compared the plain-text pages for 15 commands plus alias, module and operator pages. Patched a copy of std/help to check the fixes in the first four threads. CI's Test Std step (test_help.nu) passed on this head; I didn't rerun it.
|
Here's one more minor things that probably need to be changed. When a code snippet in backticks can't be highlighted, std help uses the full shape_external style, background included. The built-in help uses only the foreground color. |
Ok, I reverted the code so that |
|
I'm just not sure any of those will work on terminals that don't accept colors. I'm not saying they do or don't. I'm saying I don't know. |
The function I created, |
|
Thanks |



Description
Now, instead of using hardcoded colors in
std help, we retrieve them from$env.config.color_config. I did my best to match the keys to those ofhelp, so that they would look somewhat similar when custom colors have been set.I also adjusted the padding so that there would be no places with two lines of padding or no padding in between two sections.
(unrelated) While making this I noticed that the amount of indentation changes between each function. There are also some differences between the output of
std helpandhelpin terms of the sections we have and the way flags and stuff are rendered. While I did get them to match better, the diff became too large and it wouldn't at all have been in-scope for this PR, so I decided not to include them.User-facing changes (Release notes)
std helpnow honors colors set incolor_configand has the correct amount of padding.Additional notes
Closes #12109