glow/ui/config.go
Christian Rocha 2f37a2760d Bump Bubble Tea to v0.19.3 and update deprecated methods
* Update deprecated altscreen methods
* Update deprecated mouse methods
2022-02-01 12:07:16 -05:00

35 lines
981 B
Go

package ui
// Config contains TUI-specific configuration.
type Config struct {
ShowAllFiles bool
CharmHost string `env:"CHARM_HOST" default:"api.charm.sh"`
Gopath string `env:"GOPATH"`
HomeDir string `env:"HOME"`
GlamourMaxWidth uint
GlamourStyle string
EnableMouse bool
// Which directory should we start from?
WorkingDirectory string
// Which document types shall we show?
DocumentTypes DocTypeSet
// For debugging the UI
Logfile string `env:"GLOW_LOGFILE"`
HighPerformancePager bool `env:"GLOW_HIGH_PERFORMANCE_PAGER" default:"true"`
GlamourEnabled bool `env:"GLOW_ENABLE_GLAMOUR" default:"true"`
}
func (c Config) showLocalFiles() bool {
return c.DocumentTypes.Contains(LocalDoc)
}
func (c Config) localOnly() bool {
return c.DocumentTypes.Equals(NewDocTypeSet(LocalDoc))
}
func (c Config) stashedOnly() bool {
return c.DocumentTypes.Contains(StashedDoc) && !c.DocumentTypes.Contains(LocalDoc)
}