mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Correct logic for checking when we're in stashed-only-mode
This commit is contained in:
parent
e179741544
commit
f680a9b96a
2 changed files with 14 additions and 2 deletions
|
@ -137,11 +137,11 @@ type stashModel struct {
|
|||
}
|
||||
|
||||
func (m stashModel) localOnly() bool {
|
||||
return m.general.cfg.DocumentTypes.Equals(NewDocTypeSet(LocalDoc))
|
||||
return m.general.cfg.localOnly()
|
||||
}
|
||||
|
||||
func (m stashModel) stashedOnly() bool {
|
||||
return m.general.cfg.DocumentTypes.Equals(NewDocTypeSet(StashedDoc))
|
||||
return m.general.cfg.stashedOnly()
|
||||
}
|
||||
|
||||
func (m stashModel) loadingDone() bool {
|
||||
|
|
12
ui/ui.go
12
ui/ui.go
|
@ -49,6 +49,18 @@ type Config struct {
|
|||
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(NewsDoc)
|
||||
}
|
||||
|
||||
// NewProgram returns a new Tea program.
|
||||
func NewProgram(cfg Config) *tea.Program {
|
||||
if cfg.Logfile != "" {
|
||||
|
|
Loading…
Reference in a new issue