1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

more centralised handling of refreshing

This commit is contained in:
Jesse Duffield
2020-03-27 19:12:15 +11:00
parent 39315ca1e2
commit 198d237679
32 changed files with 189 additions and 126 deletions

View File

@ -194,7 +194,6 @@ type guiState struct {
Platform commands.Platform
Updating bool
Panels *panelStates
WorkingTreeState string // one of "merging", "rebasing", "normal"
MainContext string // used to keep the main and secondary views' contexts in sync
CherryPickedCommits []*commands.Commit
SplitMainPanel bool
@ -351,7 +350,7 @@ func (gui *Gui) scrollDownConfirmationPanel(g *gocui.Gui, v *gocui.View) error {
}
func (gui *Gui) handleRefresh(g *gocui.Gui, v *gocui.View) error {
return gui.refreshSidePanels(g)
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
}
func max(a, b int) int {
@ -863,7 +862,7 @@ func (gui *Gui) loadNewRepo() error {
}
gui.waitForIntro.Done()
if err := gui.refreshSidePanels(gui.g); err != nil {
if err := gui.refreshSidePanels(refreshOptions{mode: ASYNC}); err != nil {
return err
}