diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-15 12:04:00 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-15 14:15:41 +1100 |
commit | cdcfeb396fda1e61dee9b6d88ab4659152a10948 (patch) | |
tree | 6b796b8ffc9e30c08e5249e936feacca76f8d8ba /pkg/gui/files_panel.go | |
parent | f5b9ad8c002eb359959d41f4cd494007ca3e9bf3 (diff) |
stop refreshing the screen so much
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 1dd0f2d2c..05bf8d4ed 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -5,7 +5,6 @@ import ( "regexp" "strings" - "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/loaders" "github.com/jesseduffield/lazygit/pkg/commands/models" @@ -98,7 +97,7 @@ func (gui *Gui) refreshFilesAndSubmodules() error { return err } - gui.g.Update(func(g *gocui.Gui) error { + gui.OnUIThread(func() error { if err := gui.postRefreshUpdate(gui.State.Contexts.Submodules); err != nil { gui.Log.Error(err) } @@ -110,7 +109,7 @@ func (gui *Gui) refreshFilesAndSubmodules() error { } } - if gui.currentContext().GetKey() == FILES_CONTEXT_KEY || (g.CurrentView() == gui.Views.Main && ContextKey(g.CurrentView().Context) == MAIN_MERGING_CONTEXT_KEY) { + if gui.currentContext().GetKey() == FILES_CONTEXT_KEY || (gui.g.CurrentView() == gui.Views.Main && ContextKey(gui.g.CurrentView().Context) == MAIN_MERGING_CONTEXT_KEY) { newSelectedPath := gui.getSelectedPath() alreadySelected := selectedPath != "" && newSelectedPath == selectedPath if !alreadySelected { @@ -407,14 +406,11 @@ func (gui *Gui) handleCommitPress() error { } } - gui.g.Update(func(g *gocui.Gui) error { - if err := gui.pushContext(gui.State.Contexts.CommitMessage); err != nil { - return err - } + if err := gui.pushContext(gui.State.Contexts.CommitMessage); err != nil { + return err + } - gui.RenderCommitLength() - return nil - }) + gui.RenderCommitLength() return nil } |