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/global_handlers.go | |
parent | fa8571e1f4c349e401542285ea238acdbd9d17ec (diff) |
start refactoring gui
Diffstat (limited to 'pkg/gui/global_handlers.go')
-rw-r--r-- | pkg/gui/global_handlers.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index 22b43b6b7..1b4394519 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -7,6 +7,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/git_commands" + "github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -176,7 +177,7 @@ func (gui *Gui) scrollDownConfirmationPanel() error { } func (gui *Gui) handleRefresh() error { - return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) + return gui.refreshSidePanels(types.RefreshOptions{Mode: types.ASYNC}) } func (gui *Gui) handleMouseDownMain() error { @@ -218,10 +219,10 @@ func (gui *Gui) fetch() (err error) { err = gui.Git.Sync.Fetch(git_commands.FetchOptions{}) if err != nil && strings.Contains(err.Error(), "exit status 128") { - _ = gui.createErrorPanel(gui.Tr.PassUnameWrong) + _ = gui.PopupHandler.ErrorMsg(gui.Tr.PassUnameWrong) } - _ = gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{BRANCHES, COMMITS, REMOTES, TAGS}, mode: ASYNC}) + _ = gui.refreshSidePanels(types.RefreshOptions{Scope: []types.RefreshableView{types.BRANCHES, types.COMMITS, types.REMOTES, types.TAGS}, Mode: types.ASYNC}) return err } @@ -232,7 +233,7 @@ func (gui *Gui) backgroundFetch() (err error) { err = gui.Git.Sync.Fetch(git_commands.FetchOptions{Background: true}) - _ = gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{BRANCHES, COMMITS, REMOTES, TAGS}, mode: ASYNC}) + _ = gui.refreshSidePanels(types.RefreshOptions{Scope: []types.RefreshableView{types.BRANCHES, types.COMMITS, types.REMOTES, types.TAGS}, Mode: types.ASYNC}) return err } @@ -247,7 +248,7 @@ func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error { gui.logAction(gui.Tr.Actions.CopyToClipboard) if err := gui.OSCommand.CopyToClipboard(itemId); err != nil { - return gui.surfaceError(err) + return gui.PopupHandler.Error(err) } truncatedItemId := utils.TruncateWithEllipsis(strings.Replace(itemId, "\n", " ", -1), 50) |