Skip to content

fix: preserve color formatting when setting 'normal' background#595

Open
laermannjan wants to merge 1 commit intoIlanCosman:mainfrom
laermannjan:lj/preserve-color-formatting
Open

fix: preserve color formatting when setting 'normal' background#595
laermannjan wants to merge 1 commit intoIlanCosman:mainfrom
laermannjan:lj/preserve-color-formatting

Conversation

@laermannjan
Copy link

Description

From the fish docs

Using the normal keyword will reset foreground, background, and all formatting back to default.

As tide_"$item"_bg_color is often set to "normal", it currently resets any formatting (e.g. --bold) that applied to the tide_"$item"_color.
Setting the background color separately and prior to the foreground color allows for this formatting to be preserved.

Before
image

After:
image

@laermannjan
Copy link
Author

A problem I just noticed is that in many cases tide doesn't reset the formatting before setting a new color.
For example at here.
So a --bold for one of the earlier segments (e.g. stash) would also be applied to later ones.

This is probably out of scope for this PR (and maybe you don't want to support this kind of formatting at all) .
I guess we could add a apply_color wrapper where we wrap coloring an item into set_color normal calls.
Would be happy to supply another PR or add to this one, but wanted to get your thoughts on this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant