Skip to content
Myr

Fix regression in `--no-color` / `NO_COLOR` theme

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #4561

authored by Junegunn Choi · committed by Junegunn Choi · parent b852dc8 · Browse files · 3 files+17 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+17 added−8 removed

  • other:+17 added−8 removed

3 files+17 added−8 removed

modified:src/tui/tui.go+4 added-3 removed
293 unmodified lines
294 return a.Color != colUndefined295}296297func (a ColorAttr) IsAttrDefined() bool {298 return a.Attr != AttrUndefined298 return a.Attr&^BoldForce != AttrUndefined299}300301func (a ColorAttr) IsUndefined() bool {302 return !a.IsColorDefined() && !a.IsAttrDefined()303}304
851 unmodified lines
1156 // Inherit from 'fg', so that we don't have to write 'current-fg:dim'1157 // e.g. fzf --delimiter / --nth -1 --color fg:dim,nth:regular1158 current := theme.Current1159 if !baseTheme.Colored && current.IsUndefined() {1159 current.Attr = Reverse1160 current.Attr |= Reverse1161 }1162 theme.Current = theme.Fg.Merge(o(baseTheme.Current, current))1163 currentMatch := theme.CurrentMatch1164 if !baseTheme.Colored && currentMatch.IsUndefined() {1164 currentMatch.Attr = Reverse | Underline1165 currentMatch.Attr |= Reverse | Underline1166 }1167 theme.CurrentMatch = o(baseTheme.CurrentMatch, currentMatch)1168 theme.Spinner = o(baseTheme.Spinner, theme.Spinner)1169 theme.Info = o(baseTheme.Info, theme.Info)
147 unmodified lines
modified:src/options.go+3 added-1 removed
671 unmodified lines
672 return previewOpts{command, posRight, sizeSpec{50, true}, "", false, false, false, false, true, defaultBorderShape, 0, 0, nil}673}674675func defaultOptions() *Options {676 var theme *tui.ColorTheme676 var theme, baseTheme *tui.ColorTheme677 if os.Getenv("NO_COLOR") != "" {678 theme = tui.NoColorTheme679 baseTheme = tui.NoColorTheme680 } else {681 theme = tui.EmptyTheme682 }683
19 unmodified lines
703 Multi: 0,704 Ansi: false,705 Mouse: true,706 Theme: theme,707 BaseTheme: baseTheme,708 Black: false,709 Bold: true,710 MinHeight: -10,711 Layout: layoutDefault,
3073 unmodified lines
modified:CHANGELOG.md+10 added-4 removed
1CHANGELOG2=========340.66.15------6- Bug fixes7 - Fixed a bug preventing 'ctrl-h' from being bound to an action (#4556)8 - Fixed `--no-color` / `NO_COLOR` theme9100.66.011------1213### Quick summary
26 unmodified lines
40![](https://github.com/user-attachments/assets/9640ae11-b5f7-43fb-95f1-c29307fc17c2)4142This version introduces a new "raw" mode (named so because it shows the list43"unfiltered"). In raw mode, non-matching items stay in their original positions,38but appear dimmed. This allows you see surrounding items of a match and better39understand the context of it. You can enable raw mode by default with `--raw`,40but it's often more useful when toggled dynamically with the `toggle-raw`41action.44but appear dimmed. This allows you to see the surrounding items of a match and45better understand the context of it. You can enable raw mode by default with46`--raw`, but it's often more useful when toggled dynamically with the47`toggle-raw` action.4849```sh50tree | fzf --reverse --bind alt-r:toggle-raw51```
3042 unmodified lines