mirror of
https://github.com/walles/moar.git
synced 2024-11-22 11:45:50 +03:00
Remove no-longer-needed code
This commit is contained in:
parent
f26ae4ff9a
commit
43f17ebe7b
@ -156,16 +156,6 @@ func (color Color) ansiString(cType colorType, terminalColorCount ColorCount) st
|
|||||||
panic(fmt.Errorf("unhandled color type=%d %s", color.ColorCount(), color.String()))
|
panic(fmt.Errorf("unhandled color type=%d %s", color.ColorCount(), color.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (color Color) ForegroundAnsiString(terminalColorCount ColorCount) string {
|
|
||||||
// FIXME: Test this function with all different color types.
|
|
||||||
return color.ansiString(colorTypeForeground, terminalColorCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (color Color) BackgroundAnsiString(terminalColorCount ColorCount) string {
|
|
||||||
// FIXME: Test this function with all different color types.
|
|
||||||
return color.ansiString(colorTypeBackground, terminalColorCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (color Color) String() string {
|
func (color Color) String() string {
|
||||||
switch color.ColorCount() {
|
switch color.ColorCount() {
|
||||||
case ColorCountDefault:
|
case ColorCountDefault:
|
||||||
|
@ -152,11 +152,11 @@ func (current Style) RenderUpdateFrom(previous Style, terminalColorCount ColorCo
|
|||||||
|
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
if current.fg != previous.fg {
|
if current.fg != previous.fg {
|
||||||
builder.WriteString(current.fg.ForegroundAnsiString(terminalColorCount))
|
builder.WriteString(current.fg.ansiString(colorTypeForeground, terminalColorCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
if current.bg != previous.bg {
|
if current.bg != previous.bg {
|
||||||
builder.WriteString(current.bg.BackgroundAnsiString(terminalColorCount))
|
builder.WriteString(current.bg.ansiString(colorTypeBackground, terminalColorCount))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle AttrDim / AttrBold changes
|
// Handle AttrDim / AttrBold changes
|
||||||
|
Loading…
Reference in New Issue
Block a user