mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-20 15:14:17 +02:00
Only do the dark background check once
This commit is contained in:
parent
d06f4914b9
commit
f00e5ccdba
1 changed files with 9 additions and 0 deletions
9
ui/ui.go
9
ui/ui.go
|
|
@ -93,6 +93,15 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
|
|||
|
||||
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
|
||||
|
||||
if style == "auto" {
|
||||
dbg := te.HasDarkBackground()
|
||||
if dbg == true {
|
||||
style = "dark"
|
||||
} else {
|
||||
style = "light"
|
||||
}
|
||||
}
|
||||
|
||||
return model{
|
||||
style: style,
|
||||
spinner: s,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue