mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Display more keybindings on-screen
This commit is contained in:
		| @@ -52,6 +52,7 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Checkout, | ||||
| 			Tooltip:           self.c.Tr.CheckoutCommitTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Commits.CopyCommitAttributeToClipboard), | ||||
| @@ -80,6 +81,7 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			Description:       self.c.Tr.ViewResetOptions, | ||||
| 			Tooltip:           self.c.Tr.ResetTooltip, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Commits.CherryPickCopy), | ||||
| @@ -91,6 +93,7 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 					"escape": keybindings.Label(opts.Config.Universal.Return), | ||||
| 				}, | ||||
| 			), | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Commits.ResetCherryPick), | ||||
|   | ||||
| @@ -47,14 +47,16 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 				self.singleItemSelected(), | ||||
| 				self.notPulling, | ||||
| 			), | ||||
| 			Description: self.c.Tr.Checkout, | ||||
| 			Tooltip:     self.c.Tr.CheckoutTooltip, | ||||
| 			Description:     self.c.Tr.Checkout, | ||||
| 			Tooltip:         self.c.Tr.CheckoutTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:           self.withItem(self.newBranch), | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.NewBranch, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.CreatePullRequest), | ||||
| @@ -95,6 +97,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 			Description:       self.c.Tr.Delete, | ||||
| 			Tooltip:           self.c.Tr.BranchDeleteTooltip, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Branches.RebaseBranch), | ||||
| @@ -102,8 +105,9 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 			GetDisabledReason: self.require( | ||||
| 				self.singleItemSelected(self.notRebasingOntoSelf), | ||||
| 			), | ||||
| 			Description: self.c.Tr.RebaseBranch, | ||||
| 			Tooltip:     self.c.Tr.RebaseBranchTooltip, | ||||
| 			Description:     self.c.Tr.RebaseBranch, | ||||
| 			Tooltip:         self.c.Tr.RebaseBranchTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.MergeIntoCurrentBranch), | ||||
| @@ -111,6 +115,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Merge, | ||||
| 			Tooltip:           self.c.Tr.MergeBranchTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.FastForward), | ||||
| @@ -136,6 +141,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.ViewResetOptions, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.RenameBranch), | ||||
| @@ -151,6 +157,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty | ||||
| 			Tooltip:           self.c.Tr.ViewBranchUpstreamOptionsTooltip, | ||||
| 			ShortDescription:  self.c.Tr.Upstream, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -43,6 +43,7 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) [] | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Checkout, | ||||
| 			Tooltip:           self.c.Tr.CheckoutCommitFileTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Remove), | ||||
| @@ -50,6 +51,7 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) [] | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Remove, | ||||
| 			Tooltip:           self.c.Tr.DiscardOldFileChangeTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.OpenFile), | ||||
| @@ -64,6 +66,7 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) [] | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Edit, | ||||
| 			Tooltip:           self.c.Tr.EditFileTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.OpenDiffTool), | ||||
| @@ -79,6 +82,7 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) [] | ||||
| 			Tooltip: utils.ResolvePlaceholderString(self.c.Tr.ToggleAddToPatchTooltip, | ||||
| 				map[string]string{"doc": constants.Links.Docs.CustomPatchDemo}, | ||||
| 			), | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.ToggleStagedAll), | ||||
|   | ||||
| @@ -43,6 +43,7 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			GetDisabledReason: self.require(self.itemsSelected()), | ||||
| 			Description:       self.c.Tr.Stage, | ||||
| 			Tooltip:           self.c.Tr.StageTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.OpenStatusFilter), | ||||
| @@ -56,10 +57,11 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			OpensMenu:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.CommitChanges), | ||||
| 			Handler:     self.c.Helpers().WorkingTree.HandleCommitPress, | ||||
| 			Description: self.c.Tr.Commit, | ||||
| 			Tooltip:     self.c.Tr.CommitTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Files.CommitChanges), | ||||
| 			Handler:         self.c.Helpers().WorkingTree.HandleCommitPress, | ||||
| 			Description:     self.c.Tr.Commit, | ||||
| 			Tooltip:         self.c.Tr.CommitTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.CommitChangesWithoutHook), | ||||
| @@ -88,6 +90,7 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Edit, | ||||
| 			Tooltip:           self.c.Tr.EditFileTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.OpenFile), | ||||
| @@ -109,10 +112,11 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			Description: self.c.Tr.RefreshFiles, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.StashAllChanges), | ||||
| 			Handler:     self.stash, | ||||
| 			Description: self.c.Tr.Stash, | ||||
| 			Tooltip:     self.c.Tr.StashTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Files.StashAllChanges), | ||||
| 			Handler:         self.stash, | ||||
| 			Description:     self.c.Tr.Stash, | ||||
| 			Tooltip:         self.c.Tr.StashTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.ViewStashOptions), | ||||
| @@ -141,6 +145,7 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			Description:       self.c.Tr.Discard, | ||||
| 			Tooltip:           self.c.Tr.DiscardFileChangesTooltip, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Commits.ViewResetOptions), | ||||
| @@ -149,11 +154,12 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			OpensMenu:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.ViewResetOptions), | ||||
| 			Handler:     self.createResetMenu, | ||||
| 			Description: self.c.Tr.Reset, | ||||
| 			Tooltip:     self.c.Tr.FileResetOptionsTooltip, | ||||
| 			OpensMenu:   true, | ||||
| 			Key:             opts.GetKey(opts.Config.Files.ViewResetOptions), | ||||
| 			Handler:         self.createResetMenu, | ||||
| 			Description:     self.c.Tr.Reset, | ||||
| 			Tooltip:         self.c.Tr.FileResetOptionsTooltip, | ||||
| 			OpensMenu:       true, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Files.ToggleTreeView), | ||||
|   | ||||
| @@ -64,8 +64,9 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 					self.canSquashOrFixup, | ||||
| 				), | ||||
| 			), | ||||
| 			Description: self.c.Tr.Squash, | ||||
| 			Tooltip:     self.c.Tr.SquashTooltip, | ||||
| 			Description:     self.c.Tr.Squash, | ||||
| 			Tooltip:         self.c.Tr.SquashTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Commits.MarkCommitAsFixup), | ||||
| @@ -76,8 +77,9 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 					self.canSquashOrFixup, | ||||
| 				), | ||||
| 			), | ||||
| 			Description: self.c.Tr.Fixup, | ||||
| 			Tooltip:     self.c.Tr.FixupTooltip, | ||||
| 			Description:     self.c.Tr.Fixup, | ||||
| 			Tooltip:         self.c.Tr.FixupTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Commits.RenameCommit), | ||||
| @@ -85,9 +87,10 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			GetDisabledReason: self.require( | ||||
| 				self.singleItemSelected(self.rewordEnabled), | ||||
| 			), | ||||
| 			Description: self.c.Tr.Reword, | ||||
| 			Tooltip:     self.c.Tr.CommitRewordTooltip, | ||||
| 			OpensMenu:   true, | ||||
| 			Description:     self.c.Tr.Reword, | ||||
| 			Tooltip:         self.c.Tr.CommitRewordTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 			OpensMenu:       true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(opts.Config.Commits.RenameCommitWithEditor), | ||||
| @@ -105,8 +108,9 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 					self.midRebaseCommandEnabled, | ||||
| 				), | ||||
| 			), | ||||
| 			Description: self.c.Tr.DropCommit, | ||||
| 			Tooltip:     self.c.Tr.DropCommitTooltip, | ||||
| 			Description:     self.c.Tr.DropCommit, | ||||
| 			Tooltip:         self.c.Tr.DropCommitTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:     opts.GetKey(editCommitKey), | ||||
| @@ -118,6 +122,7 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			Description:      self.c.Tr.EditCommit, | ||||
| 			ShortDescription: self.c.Tr.Edit, | ||||
| 			Tooltip:          self.c.Tr.EditCommitTooltip, | ||||
| 			DisplayOnScreen:  true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			// The user-facing description here is 'Start interactive rebase' but internally | ||||
| @@ -139,6 +144,14 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			), | ||||
| 			Description: self.c.Tr.Pick, | ||||
| 			Tooltip:     self.c.Tr.PickCommitTooltip, | ||||
| 			// Not displaying this because we only want to display it when a TODO commit | ||||
| 			// is selected. A keybinding is displayed in the options view if Display is true, | ||||
| 			// and if it's not disabled, but if we disable it whenever a non-TODO commit is | ||||
| 			// selected, we'll be preventing pulls from happening within the commits view | ||||
| 			// (given they both use the 'p' key). Some approaches that come to mind: | ||||
| 			// * Allow a disabled keybinding to conditionally fallback to a global keybinding | ||||
| 			// * Allow a separate way of deciding whether a keybinding is displayed in the options view | ||||
| 			DisplayOnScreen: false, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Commits.CreateFixupCommit), | ||||
| @@ -221,6 +234,7 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected(self.canAmend)), | ||||
| 			Description:       self.c.Tr.Amend, | ||||
| 			Tooltip:           self.c.Tr.AmendCommitTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Commits.ResetCommitAuthor), | ||||
|   | ||||
| @@ -28,24 +28,28 @@ func NewMergeConflictsController( | ||||
| func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { | ||||
| 	bindings := []*types.Binding{ | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:     self.withRenderAndFocus(self.HandlePickHunk), | ||||
| 			Description: self.c.Tr.PickHunk, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:         self.withRenderAndFocus(self.HandlePickHunk), | ||||
| 			Description:     self.c.Tr.PickHunk, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Main.PickBothHunks), | ||||
| 			Handler:     self.withRenderAndFocus(self.HandlePickAllHunks), | ||||
| 			Description: self.c.Tr.PickAllHunks, | ||||
| 			Key:             opts.GetKey(opts.Config.Main.PickBothHunks), | ||||
| 			Handler:         self.withRenderAndFocus(self.HandlePickAllHunks), | ||||
| 			Description:     self.c.Tr.PickAllHunks, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.PrevItem), | ||||
| 			Handler:     self.withRenderAndFocus(self.PrevConflictHunk), | ||||
| 			Description: self.c.Tr.SelectPrevHunk, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.PrevItem), | ||||
| 			Handler:         self.withRenderAndFocus(self.PrevConflictHunk), | ||||
| 			Description:     self.c.Tr.SelectPrevHunk, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.NextItem), | ||||
| 			Handler:     self.withRenderAndFocus(self.NextConflictHunk), | ||||
| 			Description: self.c.Tr.SelectNextHunk, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.NextItem), | ||||
| 			Handler:         self.withRenderAndFocus(self.NextConflictHunk), | ||||
| 			Description:     self.c.Tr.SelectNextHunk, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.PrevBlock), | ||||
|   | ||||
| @@ -37,9 +37,10 @@ func (self *PatchBuildingController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Tooltip:     self.c.Tr.EditFileTooltip, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:     self.ToggleSelectionAndRefresh, | ||||
| 			Description: self.c.Tr.ToggleSelectionForPatch, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:         self.ToggleSelectionAndRefresh, | ||||
| 			Description:     self.c.Tr.ToggleSelectionForPatch, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Return), | ||||
|   | ||||
| @@ -92,10 +92,11 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			Description: self.c.Tr.ToggleRangeSelect, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Main.ToggleSelectHunk), | ||||
| 			Handler:     self.withRenderAndFocus(self.HandleToggleSelectHunk), | ||||
| 			Description: self.c.Tr.ToggleSelectHunk, | ||||
| 			Tooltip:     self.c.Tr.ToggleSelectHunkTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Main.ToggleSelectHunk), | ||||
| 			Handler:         self.withRenderAndFocus(self.HandleToggleSelectHunk), | ||||
| 			Description:     self.c.Tr.ToggleSelectHunk, | ||||
| 			Tooltip:         self.c.Tr.ToggleSelectHunkTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Tag:         "navigation", | ||||
|   | ||||
| @@ -41,6 +41,7 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Checkout, | ||||
| 			Tooltip:           self.c.Tr.RemoteBranchCheckoutTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.New), | ||||
| @@ -54,6 +55,7 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Merge, | ||||
| 			Tooltip:           self.c.Tr.MergeBranchTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.RebaseBranch), | ||||
| @@ -61,6 +63,7 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.RebaseBranch, | ||||
| 			Tooltip:           self.c.Tr.RebaseBranchTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Remove), | ||||
| @@ -68,6 +71,7 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Delete, | ||||
| 			Tooltip:           self.c.Tr.DeleteRemoteBranchTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.SetUpstream), | ||||
| @@ -75,6 +79,7 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts) | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.SetAsUpstream, | ||||
| 			Tooltip:           self.c.Tr.SetAsUpstreamTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Branches.SortOrder), | ||||
|   | ||||
| @@ -46,11 +46,13 @@ func (self *RemotesController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			Handler:           self.withItem(self.enter), | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.ViewBranches, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:     self.add, | ||||
| 			Description: self.c.Tr.NewRemote, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:         self.add, | ||||
| 			Description:     self.c.Tr.NewRemote, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Remove), | ||||
| @@ -58,6 +60,7 @@ func (self *RemotesController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Remove, | ||||
| 			Tooltip:           self.c.Tr.RemoveRemoteTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Edit), | ||||
| @@ -65,6 +68,7 @@ func (self *RemotesController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Edit, | ||||
| 			Tooltip:           self.c.Tr.EditRemoteTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.FetchRemote), | ||||
| @@ -72,6 +76,7 @@ func (self *RemotesController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Fetch, | ||||
| 			Tooltip:           self.c.Tr.FetchRemoteTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -40,16 +40,18 @@ func NewStagingController( | ||||
| func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { | ||||
| 	return []*types.Binding{ | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:     self.ToggleStaged, | ||||
| 			Description: self.c.Tr.Stage, | ||||
| 			Tooltip:     self.c.Tr.StageSelectionTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.Select), | ||||
| 			Handler:         self.ToggleStaged, | ||||
| 			Description:     self.c.Tr.Stage, | ||||
| 			Tooltip:         self.c.Tr.StageSelectionTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Remove), | ||||
| 			Handler:     self.DiscardSelection, | ||||
| 			Description: self.c.Tr.DiscardSelection, | ||||
| 			Tooltip:     self.c.Tr.DiscardSelectionTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.Remove), | ||||
| 			Handler:         self.DiscardSelection, | ||||
| 			Description:     self.c.Tr.DiscardSelection, | ||||
| 			Tooltip:         self.c.Tr.DiscardSelectionTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.OpenFile), | ||||
| @@ -69,10 +71,11 @@ func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*typ | ||||
| 			Description: self.c.Tr.ReturnToFilesPanel, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.TogglePanel), | ||||
| 			Handler:     self.TogglePanel, | ||||
| 			Description: self.c.Tr.ToggleStagingView, | ||||
| 			Tooltip:     self.c.Tr.ToggleStagingViewTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.TogglePanel), | ||||
| 			Handler:         self.TogglePanel, | ||||
| 			Description:     self.c.Tr.ToggleStagingView, | ||||
| 			Tooltip:         self.c.Tr.ToggleStagingViewTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Main.EditSelectHunk), | ||||
|   | ||||
| @@ -38,6 +38,7 @@ func (self *StashController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Apply, | ||||
| 			Tooltip:           self.c.Tr.StashApplyTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Stash.PopStash), | ||||
| @@ -45,6 +46,7 @@ func (self *StashController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Pop, | ||||
| 			Tooltip:           self.c.Tr.StashPopTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Remove), | ||||
| @@ -52,6 +54,7 @@ func (self *StashController) GetKeybindings(opts types.KeybindingsOpts) []*types | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Drop, | ||||
| 			Tooltip:           self.c.Tr.StashDropTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.New), | ||||
|   | ||||
| @@ -39,20 +39,23 @@ func (self *StatusController) GetKeybindings(opts types.KeybindingsOpts) []*type | ||||
| 			Tooltip:     self.c.Tr.OpenFileTooltip, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.Edit), | ||||
| 			Handler:     self.editConfig, | ||||
| 			Description: self.c.Tr.EditConfig, | ||||
| 			Tooltip:     self.c.Tr.EditFileTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.Edit), | ||||
| 			Handler:         self.editConfig, | ||||
| 			Description:     self.c.Tr.EditConfig, | ||||
| 			Tooltip:         self.c.Tr.EditFileTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Status.CheckForUpdate), | ||||
| 			Handler:     self.handleCheckForUpdate, | ||||
| 			Description: self.c.Tr.CheckForUpdate, | ||||
| 			Key:             opts.GetKey(opts.Config.Status.CheckForUpdate), | ||||
| 			Handler:         self.handleCheckForUpdate, | ||||
| 			Description:     self.c.Tr.CheckForUpdate, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Status.RecentRepos), | ||||
| 			Handler:     self.c.Helpers().Repos.CreateRecentReposMenu, | ||||
| 			Description: self.c.Tr.SwitchRepo, | ||||
| 			Key:             opts.GetKey(opts.Config.Status.RecentRepos), | ||||
| 			Handler:         self.c.Helpers().Repos.CreateRecentReposMenu, | ||||
| 			Description:     self.c.Tr.SwitchRepo, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Status.AllBranchesLogGraph), | ||||
|   | ||||
| @@ -46,6 +46,7 @@ func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []* | ||||
| 			Description:       self.c.Tr.Enter, | ||||
| 			Tooltip: utils.ResolvePlaceholderString(self.c.Tr.EnterSubmoduleTooltip, | ||||
| 				map[string]string{"escape": keybindings.Label(opts.Config.Universal.Return)}), | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Select), | ||||
| @@ -58,6 +59,7 @@ func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []* | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Remove, | ||||
| 			Tooltip:           self.c.Tr.RemoveSubmoduleTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Submodules.Update), | ||||
| @@ -65,11 +67,13 @@ func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []* | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Update, | ||||
| 			Tooltip:           self.c.Tr.SubmoduleUpdateTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:     self.add, | ||||
| 			Description: self.c.Tr.NewSubmodule, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:         self.add, | ||||
| 			Description:     self.c.Tr.NewSubmodule, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Edit), | ||||
|   | ||||
| @@ -39,12 +39,14 @@ func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types. | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Checkout, | ||||
| 			Tooltip:           self.c.Tr.TagCheckoutTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:     self.create, | ||||
| 			Description: self.c.Tr.NewTag, | ||||
| 			Tooltip:     self.c.Tr.NewTagTooltip, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:         self.create, | ||||
| 			Description:     self.c.Tr.NewTag, | ||||
| 			Tooltip:         self.c.Tr.NewTagTooltip, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Remove), | ||||
| @@ -53,6 +55,7 @@ func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types. | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Tooltip:           self.c.Tr.TagDeleteTooltip, | ||||
| 			OpensMenu:         true, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Branches.PushTag), | ||||
| @@ -60,6 +63,7 @@ func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types. | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.PushTag, | ||||
| 			Tooltip:           self.c.Tr.PushTagTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Commits.ViewResetOptions), | ||||
| @@ -67,6 +71,7 @@ func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types. | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Reset, | ||||
| 			Tooltip:           self.c.Tr.ResetTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 			OpensMenu:         true, | ||||
| 		}, | ||||
| 	} | ||||
|   | ||||
| @@ -37,9 +37,10 @@ func NewWorktreesController( | ||||
| func (self *WorktreesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { | ||||
| 	bindings := []*types.Binding{ | ||||
| 		{ | ||||
| 			Key:         opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:     self.add, | ||||
| 			Description: self.c.Tr.NewWorktree, | ||||
| 			Key:             opts.GetKey(opts.Config.Universal.New), | ||||
| 			Handler:         self.add, | ||||
| 			Description:     self.c.Tr.NewWorktree, | ||||
| 			DisplayOnScreen: true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Select), | ||||
| @@ -47,6 +48,7 @@ func (self *WorktreesController) GetKeybindings(opts types.KeybindingsOpts) []*t | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Switch, | ||||
| 			Tooltip:           self.c.Tr.SwitchToWorktreeTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 		{ | ||||
| 			Key:               opts.GetKey(opts.Config.Universal.Confirm), | ||||
| @@ -65,6 +67,7 @@ func (self *WorktreesController) GetKeybindings(opts types.KeybindingsOpts) []*t | ||||
| 			GetDisabledReason: self.require(self.singleItemSelected()), | ||||
| 			Description:       self.c.Tr.Remove, | ||||
| 			Tooltip:           self.c.Tr.RemoveWorktreeTooltip, | ||||
| 			DisplayOnScreen:   true, | ||||
| 		}, | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user