From b74f696cc8199d2d8d8d74e9484db6010baf76ca Mon Sep 17 00:00:00 2001 From: Jonah Date: Tue, 5 Jul 2022 20:38:10 +0000 Subject: [PATCH] feat(list): add `IsFiltered` method (#98) --- list/list.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/list/list.go b/list/list.go index f755499..bec5e6f 100644 --- a/list/list.go +++ b/list/list.go @@ -534,6 +534,15 @@ func (m Model) SettingFilter() bool { return m.filterState == Filtering } +// IsFiltered returns whether or not the list is currently filtered. +// It's purely a convenience method for the following: +// +// m.FilterState() == FilterApplied +// +func (m Model) IsFiltered() bool { + return m.filterState == FilterApplied +} + // Width returns the current width setting. func (m Model) Width() int { return m.width