diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-28 20:44:36 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | a90b6efded49abcfa2516db794d7875b0396f558 (patch) | |
tree | ad9c3738830437064ada223f0978dab1d726b479 /pkg/gui/filtering.go | |
parent | fa8571e1f4c349e401542285ea238acdbd9d17ec (diff) |
start refactoring gui
Diffstat (limited to 'pkg/gui/filtering.go')
-rw-r--r-- | pkg/gui/filtering.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pkg/gui/filtering.go b/pkg/gui/filtering.go index 1f5c5032a..df007b69a 100644 --- a/pkg/gui/filtering.go +++ b/pkg/gui/filtering.go @@ -1,11 +1,16 @@ package gui +import ( + "github.com/jesseduffield/lazygit/pkg/gui/popup" + "github.com/jesseduffield/lazygit/pkg/gui/types" +) + func (gui *Gui) validateNotInFilterMode() (bool, error) { if gui.State.Modes.Filtering.Active() { - err := gui.ask(askOpts{ - title: gui.Tr.MustExitFilterModeTitle, - prompt: gui.Tr.MustExitFilterModePrompt, - handleConfirm: gui.exitFilterMode, + err := gui.PopupHandler.Ask(popup.AskOpts{ + Title: gui.Tr.MustExitFilterModeTitle, + Prompt: gui.Tr.MustExitFilterModePrompt, + HandleConfirm: gui.exitFilterMode, }) return false, err @@ -23,7 +28,7 @@ func (gui *Gui) clearFiltering() error { gui.State.ScreenMode = SCREEN_NORMAL } - return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{COMMITS}}) + return gui.refreshSidePanels(types.RefreshOptions{Scope: []types.RefreshableView{types.COMMITS}}) } func (gui *Gui) setFiltering(path string) error { @@ -36,7 +41,7 @@ func (gui *Gui) setFiltering(path string) error { return err } - return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{COMMITS}, then: func() { + return gui.refreshSidePanels(types.RefreshOptions{Scope: []types.RefreshableView{types.COMMITS}, Then: func() { gui.State.Contexts.BranchCommits.GetPanelState().SetSelectedLineIdx(0) }}) } |