diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-05 00:53:34 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-06 19:34:32 +1000 |
commit | 952c62df37f839004a80fa393f4ddb42683fc41f (patch) | |
tree | 974c8b5326df112104d1691e3f5cf97fa95a8df7 /pkg/gui/context.go | |
parent | b6cc1c949221810966b3c3cb4a386dc6c7faa023 (diff) |
fix bug where searching through view got stuck if you went over the upper bound
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r-- | pkg/gui/context.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 67ded3060..56058743c 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -665,18 +665,18 @@ func (gui *Gui) onViewFocusChange() error { return nil } -func (gui *Gui) onViewFocusLost(v *gocui.View, newView *gocui.View) error { - if v == nil { +func (gui *Gui) onViewFocusLost(oldView *gocui.View, newView *gocui.View) error { + if oldView == nil { return nil } - if v.IsSearching() && newView.Name() != "search" { + if oldView.IsSearching() && newView != gui.Views.Search { if err := gui.onSearchEscape(); err != nil { return err } } - if v.Name() == "commitFiles" && newView.Name() != "main" && newView.Name() != "secondary" { + if oldView == gui.Views.CommitFiles && newView != gui.Views.Main && newView != gui.Views.Secondary && newView != gui.Views.Search { gui.resetWindowForView("commitFiles") if err := gui.deactivateContext(gui.State.Contexts.CommitFiles); err != nil { return err |