From b0f6e68211a057781249a7a6d638bdb10e09ee26 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 8 May 2025 14:56:19 +0200 Subject: [PATCH] Remove unused keybinding handler It's never called, the binding ListController.HandleGotoBottom wins. The functionality of loading more commits is implemented by GetOnFocus, and this way it works not only for '>', but also for other navigation keys like page down. --- .../controllers/local_commits_controller.go | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go index ad844f90e..2b6f3d5c0 100644 --- a/pkg/gui/controllers/local_commits_controller.go +++ b/pkg/gui/controllers/local_commits_controller.go @@ -207,14 +207,6 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ Description: self.c.Tr.MarkAsBaseCommit, Tooltip: self.c.Tr.MarkAsBaseCommitTooltip, }, - // overriding this navigation keybinding because we might need to load - // more commits on demand - { - Key: opts.GetKey(opts.Config.Universal.GotoBottom), - Handler: self.gotoBottom, - Description: self.c.Tr.GotoBottom, - Tag: "navigation", - }, } for _, binding := range outsideFilterModeBindings { @@ -1154,20 +1146,6 @@ func (self *LocalCommitsController) openSearch() error { return self.c.Helpers().Search.OpenSearchPrompt(self.context()) } -func (self *LocalCommitsController) gotoBottom() error { - // we usually lazyload these commits but now that we're jumping to the bottom we need to load them now - if self.context().GetLimitCommits() { - self.context().SetLimitCommits(false) - if err := self.c.Refresh(types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.COMMITS}}); err != nil { - return err - } - } - - self.context().SetSelectedLineIdx(self.context().Len() - 1) - - return nil -} - func (self *LocalCommitsController) handleOpenLogMenu() error { return self.c.Menu(types.CreateMenuOptions{ Title: self.c.Tr.LogMenuTitle,