diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-13 19:15:22 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 85f23198971de56195a4a1790d70e9d3b4ea1908 (patch) | |
tree | 0f5fffab65633201a864a9846ff1b3de0eccd6ce /pkg/gui/commit_files_panel.go | |
parent | c685a413c94d06f154587015a86701ec82d2ee0c (diff) |
refactor custom commands panel
Diffstat (limited to 'pkg/gui/commit_files_panel.go')
-rw-r--r-- | pkg/gui/commit_files_panel.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go index 610973399..df37f6b41 100644 --- a/pkg/gui/commit_files_panel.go +++ b/pkg/gui/commit_files_panel.go @@ -256,6 +256,13 @@ func (gui *Gui) handleToggleCommitFileDirCollapsed() error { return nil } +// NOTE: this is very similar to handleToggleFileTreeView, could be DRY'd with generics +func (gui *Gui) handleToggleCommitFileTreeView() error { + gui.State.Contexts.CommitFiles.CommitFileTreeViewModel.ToggleShowTree() + + return gui.c.PostRefreshUpdate(gui.State.Contexts.CommitFiles) +} + func (gui *Gui) SwitchToCommitFilesContext(opts controllers.SwitchToCommitFilesContextOpts) error { // sometimes the commitFiles view is already shown in another window, so we need to ensure that window // no longer considers the commitFiles view as its main view. @@ -273,10 +280,3 @@ func (gui *Gui) SwitchToCommitFilesContext(opts controllers.SwitchToCommitFilesC return gui.c.PushContext(gui.State.Contexts.CommitFiles) } - -// NOTE: this is very similar to handleToggleFileTreeView, could be DRY'd with generics -func (gui *Gui) handleToggleCommitFileTreeView() error { - gui.State.Contexts.CommitFiles.CommitFileTreeViewModel.ToggleShowTree() - - return gui.c.PostRefreshUpdate(gui.State.Contexts.CommitFiles) -} |