diff --git a/ui/stash.go b/ui/stash.go index 16530b9..feb5ab5 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -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 { diff --git a/ui/ui.go b/ui/ui.go index e8d74f9..5ed2f87 100644 --- a/ui/ui.go +++ b/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 != "" {