summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-05-27 20:38:49 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-03 12:54:13 +1000
commit84870d45038e206a71aa3160d681a2b9d9827aa9 (patch)
tree98bfce02e94fa42ef72f117730092bef96351ea0 /pkg/gui/context.go
parenta9e2c8129f6e1cdfd58446d7ce5080fcabc2ea04 (diff)
Cancel filter/search when hitting escape
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r--pkg/gui/context.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go
index 26cec4c23..7c669cbff 100644
--- a/pkg/gui/context.go
+++ b/pkg/gui/context.go
@@ -211,7 +211,7 @@ func (self *ContextMgr) deactivateContext(c types.Context, opts types.OnFocusLos
}
if filterableContext, ok := c.(types.IFilterableContext); ok {
- if filterableContext.GetFilter() != "" {
+ if filterableContext.IsFiltering() {
filterableContext.ClearFilter()
self.gui.helpers.Search.Cancel()
}
@@ -247,12 +247,12 @@ func (self *ContextMgr) ActivateContext(c types.Context, opts types.OnFocusOpts)
}
if searchableContext, ok := c.(types.ISearchableContext); ok {
- if searchableContext.GetSearchString() != "" {
+ if searchableContext.IsSearching() {
self.gui.helpers.Search.DisplaySearchPrompt(searchableContext)
}
}
if filterableContext, ok := c.(types.IFilterableContext); ok {
- if filterableContext.GetFilter() != "" {
+ if filterableContext.IsFiltering() {
self.gui.helpers.Search.DisplayFilterPrompt(filterableContext)
}
}