mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-13 22:17:05 +02:00
Fix setting gui.selectedRangeBgColor as a hex value
This commit is contained in:
parent
ed47529604
commit
63e8b8c01c
@ -30,9 +30,9 @@ func GetTextStyle(keys []string, background bool) style.TextStyle {
|
|||||||
} else if utils.IsValidHexValue(key) {
|
} else if utils.IsValidHexValue(key) {
|
||||||
c := style.NewRGBColor(color.HEX(key, background))
|
c := style.NewRGBColor(color.HEX(key, background))
|
||||||
if background {
|
if background {
|
||||||
s.SetBg(c)
|
s = s.SetBg(c)
|
||||||
} else {
|
} else {
|
||||||
s.SetFg(c)
|
s = s.SetFg(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,21 +37,13 @@ func TestGetTextStyle(t *testing.T) {
|
|||||||
name: "hex color, fg",
|
name: "hex color, fg",
|
||||||
keys: []string{"#123456"},
|
keys: []string{"#123456"},
|
||||||
background: false,
|
background: false,
|
||||||
/* EXPECTED:
|
|
||||||
expected: style.New().SetFg(style.NewRGBColor(color.RGBColor{0x12, 0x34, 0x56, 0})),
|
expected: style.New().SetFg(style.NewRGBColor(color.RGBColor{0x12, 0x34, 0x56, 0})),
|
||||||
ACTUAL:
|
|
||||||
*/
|
|
||||||
expected: style.New(),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "hex color, bg",
|
name: "hex color, bg",
|
||||||
keys: []string{"#abcdef"},
|
keys: []string{"#abcdef"},
|
||||||
background: true,
|
background: true,
|
||||||
/* EXPECTED:
|
|
||||||
expected: style.New().SetBg(style.NewRGBColor(color.RGBColor{0xab, 0xcd, 0xef, 1})),
|
expected: style.New().SetBg(style.NewRGBColor(color.RGBColor{0xab, 0xcd, 0xef, 1})),
|
||||||
ACTUAL:
|
|
||||||
*/
|
|
||||||
expected: style.New(),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user