Skip to content
Myr

Keep base fg/bg when resolving colors in bw theme

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

Trailing prompt space and other base-colored segments no longer reset to terminal default

authored by Junegunn Choi · committed by Junegunn Choi · parent abee152 · Browse files · 1 file+4 added−1 removed
This commit

State

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

Diff stats

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:src/result.go+4 added-1 removed
196 unmodified lines
197 curr := cellInfo{0, false, false, false, -1}198 start := 0199 ansiToColorPair := func(ansi ansiOffset, base tui.ColorPair) tui.ColorPair {200 if !theme.Colored {201 // Ignore ANSI colors but keep the attributes. Retain the base202 // colors (e.g. an overridden input-bg or list-bg) instead of203 // resetting to the terminal default.201 return tui.NewColorPair(-1, -1, ansi.color.attr).MergeAttr(base)204 return tui.NewColorPair(base.Fg(), base.Bg(), ansi.color.attr).MergeAttr(base)205 }206 // fd --color always | fzf --ansi --delimiter / --nth -1 --color fg:dim:strip,nth:regular207 if base.ShouldStripColors() {208 return base
216 unmodified lines