diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-19 19:26:05 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | e4beaf4de96afee804d019e7c19eee833d3b1801 (patch) | |
tree | e432775a74aa78a533799da888a55dc55e233e66 /pkg/gui/commits_panel.go | |
parent | d4f134c6c7476e42ccd011a22bd31a195a6bc88d (diff) |
more stuff
Diffstat (limited to 'pkg/gui/commits_panel.go')
-rw-r--r-- | pkg/gui/commits_panel.go | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 1103b6867..7f6e0a5e4 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -7,7 +7,6 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/gui/presentation" - "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -633,40 +632,10 @@ func (gui *Gui) renderBranchCommitsWithSelection() error { gui.refreshSelectedLine(&gui.State.Panels.Commits.SelectedLine, len(gui.State.Commits)) displayStrings := presentation.GetCommitListDisplayStrings(gui.State.Commits, gui.State.ScreenMode != SCREEN_NORMAL, gui.cherryPickedCommitShaMap(), gui.State.Diff.Ref) gui.renderDisplayStrings(commitsView, displayStrings) - if gui.g.CurrentView() == commitsView && commitsView.Context == "branch-commits" { - if err := gui.handleCommitSelect(); err != nil { - return err - } - } return nil } -func (gui *Gui) onCommitsTabClick(tabIndex int) error { - contexts := []string{"branch-commits", "reflog-commits"} - commitsView := gui.getCommitsView() - commitsView.TabIndex = tabIndex - - return gui.switchCommitsPanelContext(contexts[tabIndex]) -} - -func (gui *Gui) switchCommitsPanelContext(context string) error { - commitsView := gui.getCommitsView() - commitsView.Context = context - if err := gui.onSearchEscape(); err != nil { - return err - } - - contextTabIndexMap := map[string]int{ - "branch-commits": 0, - "reflog-commits": 1, - } - - commitsView.TabIndex = contextTabIndexMap[context] - - return gui.refreshCommitsViewWithSelection() -} - func (gui *Gui) refreshCommitsViewWithSelection() error { commitsView := gui.getCommitsView() @@ -680,18 +649,6 @@ func (gui *Gui) refreshCommitsViewWithSelection() error { return nil } -func (gui *Gui) handleNextCommitsTab(g *gocui.Gui, v *gocui.View) error { - return gui.onCommitsTabClick( - utils.ModuloWithWrap(v.TabIndex+1, len(v.Tabs)), - ) -} - -func (gui *Gui) handlePrevCommitsTab(g *gocui.Gui, v *gocui.View) error { - return gui.onCommitsTabClick( - utils.ModuloWithWrap(v.TabIndex-1, len(v.Tabs)), - ) -} - func (gui *Gui) handleCreateCommitResetMenu(g *gocui.Gui, v *gocui.View) error { commit := gui.getSelectedCommit() if commit == nil { |