summaryrefslogtreecommitdiffstats
path: root/pkg/gui/information_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-23 18:47:29 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commitdb12853bbe825d69686ea71161497d1bbb120b8e (patch)
treeebfb066dfef8eb75acdc1ea2bd5f15ff4f4a6507 /pkg/gui/information_panel.go
parent711674f6cd68ed3a35e5b0329ff0cf3289fbc7d1 (diff)
lots of changes
Diffstat (limited to 'pkg/gui/information_panel.go')
-rw-r--r--pkg/gui/information_panel.go21
1 files changed, 4 insertions, 17 deletions
diff --git a/pkg/gui/information_panel.go b/pkg/gui/information_panel.go
index 1577e3a2e..5de212b4d 100644
--- a/pkg/gui/information_panel.go
+++ b/pkg/gui/information_panel.go
@@ -3,15 +3,14 @@ package gui
import (
"fmt"
- "github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/constants"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/mattn/go-runewidth"
)
func (gui *Gui) informationStr() string {
- if activeMode, ok := gui.getActiveMode(); ok {
- return activeMode.description()
+ if activeMode, ok := gui.helpers.Mode.GetActiveMode(); ok {
+ return activeMode.Description()
}
if gui.g.Mouse {
@@ -23,18 +22,6 @@ func (gui *Gui) informationStr() string {
}
}
-func (gui *Gui) getActiveMode() (modeStatus, bool) {
- return slices.Find(gui.modeStatuses(), func(mode modeStatus) bool {
- return mode.isActive()
- })
-}
-
-func (gui *Gui) isAnyModeActive() bool {
- return slices.Some(gui.modeStatuses(), func(mode modeStatus) bool {
- return mode.isActive()
- })
-}
-
func (gui *Gui) handleInfoClick() error {
if !gui.g.Mouse {
return nil
@@ -45,11 +32,11 @@ func (gui *Gui) handleInfoClick() error {
cx, _ := view.Cursor()
width, _ := view.Size()
- if activeMode, ok := gui.getActiveMode(); ok {
+ if activeMode, ok := gui.helpers.Mode.GetActiveMode(); ok {
if width-cx > runewidth.StringWidth(gui.c.Tr.ResetInParentheses) {
return nil
}
- return activeMode.reset()
+ return activeMode.Reset()
}
// if we're not in an active mode we show the donate button