mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
fix: set active colors in debug
This commit is contained in:
parent
2d3b6e4e23
commit
d3ab141cd5
12
src/block.go
12
src/block.go
|
@ -58,6 +58,12 @@ func (b *Block) initPlain(env environmentInfo, config *Config) {
|
||||||
b.env = env
|
b.env = env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Block) setActiveSegment(segment *Segment) {
|
||||||
|
b.activeSegment = segment
|
||||||
|
b.activeBackground = segment.background()
|
||||||
|
b.activeForeground = segment.foreground()
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Block) enabled() bool {
|
func (b *Block) enabled() bool {
|
||||||
if b.Type == LineBreak {
|
if b.Type == LineBreak {
|
||||||
return true
|
return true
|
||||||
|
@ -88,9 +94,7 @@ func (b *Block) renderSegments() string {
|
||||||
if !segment.active {
|
if !segment.active {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
b.activeSegment = segment
|
b.setActiveSegment(segment)
|
||||||
b.activeBackground = b.activeSegment.background()
|
|
||||||
b.activeForeground = b.activeSegment.foreground()
|
|
||||||
b.writer.setColors(b.activeBackground, b.activeForeground)
|
b.writer.setColors(b.activeBackground, b.activeForeground)
|
||||||
b.endPowerline()
|
b.endPowerline()
|
||||||
b.renderSegmentText(segment.stringValue)
|
b.renderSegmentText(segment.stringValue)
|
||||||
|
@ -202,7 +206,7 @@ func (b *Block) debug() (int, []*SegmentTiming) {
|
||||||
segmentTiming.stringValue = segment.string()
|
segmentTiming.stringValue = segment.string()
|
||||||
segmentTiming.stringDuration = time.Since(start)
|
segmentTiming.stringDuration = time.Since(start)
|
||||||
b.previousActiveSegment = nil
|
b.previousActiveSegment = nil
|
||||||
b.activeSegment = segment
|
b.setActiveSegment(segment)
|
||||||
b.renderSegmentText(segmentTiming.stringValue)
|
b.renderSegmentText(segmentTiming.stringValue)
|
||||||
if b.activeSegment.Style == Powerline {
|
if b.activeSegment.Style == Powerline {
|
||||||
b.writePowerLineSeparator(Transparent, b.activeBackground, true)
|
b.writePowerLineSeparator(Transparent, b.activeBackground, true)
|
||||||
|
|
Loading…
Reference in a new issue