summaryrefslogtreecommitdiffstats
path: root/pkg/gui/view_helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r--pkg/gui/view_helpers.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 53cf80de5..dcb58c7de 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -287,8 +287,8 @@ func (gui *Gui) trimmedContent(v *gocui.View) string {
return strings.TrimSpace(v.Buffer())
}
-func (gui *Gui) currentViewName(g *gocui.Gui) string {
- currentView := g.CurrentView()
+func (gui *Gui) currentViewName() string {
+ currentView := gui.g.CurrentView()
return currentView.Name()
}
@@ -380,3 +380,20 @@ func (gui *Gui) renderPanelOptions() error {
}
return gui.renderGlobalOptions()
}
+
+func (gui *Gui) handleFocusView(g *gocui.Gui, v *gocui.View) error {
+ _, err := gui.g.SetCurrentView(v.Name())
+ return err
+}
+
+func (gui *Gui) popupPanelFocused() bool {
+ viewNames := []string{"commitMessage",
+ "credentials",
+ "menu"}
+ for _, viewName := range viewNames {
+ if gui.currentViewName() == viewName {
+ return true
+ }
+ }
+ return false
+}