diff options
-rw-r--r-- | docs/Config.md | 1 | ||||
-rw-r--r-- | pkg/commands/os.go | 11 | ||||
-rw-r--r-- | pkg/config/app_config.go | 1 | ||||
-rw-r--r-- | pkg/config/config_default_platform.go | 3 | ||||
-rw-r--r-- | pkg/config/config_linux.go | 3 | ||||
-rw-r--r-- | pkg/config/config_windows.go | 3 | ||||
-rw-r--r-- | pkg/gui/branches_panel.go | 9 | ||||
-rw-r--r-- | pkg/gui/commits_panel.go | 9 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 146 | ||||
-rw-r--r-- | pkg/i18n/english.go | 6 |
10 files changed, 57 insertions, 135 deletions
diff --git a/docs/Config.md b/docs/Config.md index d6f4b9e00..0362c4a86 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -91,6 +91,7 @@ Default path for the config file: redo: '<c-z>' filteringMenu: <c-s> diffingMenu: '<c-e>' + copyToClipboard: '<c-o>' status: checkForUpdate: 'u' recentRepos: '<enter>' diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 517372662..98317312d 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -454,3 +454,14 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err cmd.Wait() return nil } + +func (c *OSCommand) CopyToClipboard(str string) error { + commandTemplate := c.Config.GetUserConfig().GetString("os.copyToClipboardCommand") + templateValues := map[string]string{ + "str": c.Quote(str), + } + + command := utils.ResolvePlaceholderString(commandTemplate, templateValues) + + return c.RunCommand(command) +} diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 9db3ce547..76f2fb76f 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -322,6 +322,7 @@ keybinding: redo: '<c-z>' filteringMenu: <c-s> diffingMenu: '<c-e>' + copyToClipboard: '<c-o>' status: checkForUpdate: 'u' recentRepos: '<enter>' diff --git a/pkg/config/config_default_platform.go b/pkg/config/config_default_platform.go index df205c0d7..0eccd96ab 100644 --- a/pkg/config/config_default_platform.go +++ b/pkg/config/config_default_platform.go @@ -7,5 +7,6 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'open {{filename}}' - openLinkCommand: 'open {{link}}'`) + openLinkCommand: 'open {{link}}' + copyToClipboardCommand: 'bash -c "echo -n {{str}} | pbcopy"'`) } diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 2dfbdb1c6..8f3223cfc 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -5,5 +5,6 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"' - openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"'`) + openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"' + copyToClipboardCommand: 'bash -c "echo -n {{str}} | xclip -selection clipboard"'`) } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 6f6560316..d56483af8 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -5,5 +5,6 @@ func GetPlatformDefaultConfig() []byte { return []byte( `os: openCommand: 'cmd /c "start "" {{filename}}"' - openLinkCommand: 'cmd /c "start "" {{link}}"'`) + openLinkCommand: 'cmd /c "start "" {{link}}"' + copyToClipboardCommand: 'cmd \c "echo -n {{str}} > /dev/clipboard"`) } diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index c3bbcb059..75c01d0e1 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -520,3 +520,12 @@ func (gui *Gui) currentBranch() *commands.Branch { } return gui.State.Branches[0] } + +func (gui *Gui) handleClipboardCopyBranch(g *gocui.Gui, v *gocui.View) error { + branch := gui.getSelectedBranch() + if branch == nil { + return nil + } + + return gui.OSCommand.CopyToClipboard(branch.Name) +} diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index cda71eb42..c7ea04b20 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -703,3 +703,12 @@ func (gui *Gui) handleGotoBottomForCommitsPanel(g *gocui.Gui, v *gocui.View) err return nil } + +func (gui *Gui) handleClipboardCopyCommit(g *gocui.Gui, v *gocui.View) error { + commit := gui.getSelectedCommit() + if commit == nil { + return nil + } + + return gui.OSCommand.CopyToClipboard(commit.Sha) +} diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 5ee8466d3..01447a67b 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -222,7 +222,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "", Key: gui.getKey("universal.scrollUpMain"), - Modifier: gocui.ModNone, Handler: gui.scrollUpMain, Alternative: "fn+up", Description: gui.Tr.SLocalize("scrollUpMainPanel"), @@ -230,7 +229,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "", Key: gui.getKey("universal.scrollDownMain"), - Modifier: gocui.ModNone, Handler: gui.scrollDownMain, Alternative: "fn+down", Description: gui.Tr.SLocalize("scrollDownMainPanel"), @@ -262,42 +260,36 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "", Key: gui.getKey("universal.createRebaseOptionsMenu"), - Modifier: gocui.ModNone, Handler: gui.handleCreateRebaseOptionsMenu, Description: gui.Tr.SLocalize("ViewMergeRebaseOptions"), }, { ViewName: "", Key: gui.getKey("universal.createPatchOptionsMenu"), - Modifier: gocui.ModNone, Handler: gui.handleCreatePatchOptionsMenu, Description: gui.Tr.SLocalize("ViewPatchOptions"), }, { ViewName: "", Key: gui.getKey("universal.pushFiles"), - Modifier: gocui.ModNone, Handler: gui.pushFiles, Description: gui.Tr.SLocalize("push"), }, { ViewName: "", Key: gui.getKey("universal.pullFiles"), - Modifier: gocui.ModNone, Handler: gui.handlePullFiles, Description: gui.Tr.SLocalize("pull"), }, { ViewName: "", Key: gui.getKey("universal.refresh"), - Modifier: gocui.ModNone, Handler: gui.handleRefresh, Description: gui.Tr.SLocalize("refresh"), }, { ViewName: "", Key: gui.getKey("universal.optionMenu"), - Modifier: gocui.ModNone, Handler: gui.handleCreateOptionsMenu, Description: gui.Tr.SLocalize("openMenu"), }, @@ -316,182 +308,156 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "", Key: gui.getKey("universal.undo"), - Modifier: gocui.ModNone, Handler: gui.reflogUndo, Description: gui.Tr.SLocalize("undoReflog"), }, { ViewName: "", Key: gui.getKey("universal.redo"), - Modifier: gocui.ModNone, Handler: gui.reflogRedo, Description: gui.Tr.SLocalize("redoReflog"), }, { ViewName: "status", Key: gui.getKey("universal.edit"), - Modifier: gocui.ModNone, Handler: gui.handleEditConfig, Description: gui.Tr.SLocalize("EditConfig"), }, { ViewName: "", Key: gui.getKey("universal.nextScreenMode"), - Modifier: gocui.ModNone, Handler: gui.nextScreenMode, Description: gui.Tr.SLocalize("nextScreenMode"), }, { ViewName: "", Key: gui.getKey("universal.prevScreenMode"), - Modifier: gocui.ModNone, Handler: gui.prevScreenMode, Description: gui.Tr.SLocalize("prevScreenMode"), }, { ViewName: "status", Key: gui.getKey("universal.openFile"), - Modifier: gocui.ModNone, Handler: gui.handleOpenConfig, Description: gui.Tr.SLocalize("OpenConfig"), }, { ViewName: "status", Key: gui.getKey("status.checkForUpdate"), - Modifier: gocui.ModNone, Handler: gui.handleCheckForUpdate, Description: gui.Tr.SLocalize("checkForUpdate"), }, { ViewName: "status", Key: gui.getKey("status.recentRepos"), - Modifier: gocui.ModNone, Handler: gui.handleCreateRecentReposMenu, Description: gui.Tr.SLocalize("SwitchRepo"), }, { ViewName: "files", Key: gui.getKey("files.commitChanges"), - Modifier: gocui.ModNone, Handler: gui.handleCommitPress, Description: gui.Tr.SLocalize("CommitChanges"), }, { ViewName: "files", Key: gui.getKey("files.commitChangesWithoutHook"), - Modifier: gocui.ModNone, Handler: gui.handleWIPCommitPress, Description: gui.Tr.SLocalize("commitChangesWithoutHook"), }, { ViewName: "files", Key: gui.getKey("files.amendLastCommit"), - Modifier: gocui.ModNone, Handler: gui.handleAmendCommitPress, Description: gui.Tr.SLocalize("AmendLastCommit"), }, { ViewName: "files", Key: gui.getKey("files.commitChangesWithEditor"), - Modifier: gocui.ModNone, Handler: gui.handleCommitEditorPress, Description: gui.Tr.SLocalize("CommitChangesWithEditor"), }, { ViewName: "files", Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleFilePress, Description: gui.Tr.SLocalize("toggleStaged"), }, { ViewName: "files", Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleCreateDiscardMenu, Description: gui.Tr.SLocalize("viewDiscardOptions"), }, { ViewName: "files", Key: gui.getKey("universal.edit"), - Modifier: gocui.ModNone, Handler: gui.handleFileEdit, Description: gui.Tr.SLocalize("editFile"), }, { ViewName: "files", Key: gui.getKey("universal.openFile"), - Modifier: gocui.ModNone, Handler: gui.handleFileOpen, Description: gui.Tr.SLocalize("openFile"), }, { ViewName: "files", Key: gui.getKey("files.ignoreFile"), - Modifier: gocui.ModNone, Handler: gui.handleIgnoreFile, Description: gui.Tr.SLocalize("ignoreFile"), }, { ViewName: "files", Key: gui.getKey("files.refreshFiles"), - Modifier: gocui.ModNone, Handler: gui.handleRefreshFiles, Description: gui.Tr.SLocalize("refreshFiles"), }, { ViewName: "files", Key: gui.getKey("files.stashAllChanges"), - Modifier: gocui.ModNone, Handler: gui.handleStashChanges, Description: gui.Tr.SLocalize("stashAllChanges"), }, { ViewName: "files", Key: gui.getKey("files.viewStashOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateStashMenu, Description: gui.Tr.SLocalize("viewStashOptions"), }, { ViewName: "files", Key: gui.getKey("files.toggleStagedAll"), - Modifier: gocui.ModNone, Handler: gui.handleStageAll, Description: gui.Tr.SLocalize("toggleStagedAll"), }, { ViewName: "files", Key: gui.getKey("files.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateResetMenu, Description: gui.Tr.SLocalize("viewResetOptions"), }, { ViewName: "files", Key: gui.getKey("universal.goInto"), - Modifier: gocui.ModNone, Handler: gui.handleEnterFile, Description: gui.Tr.SLocalize("StageLines"), }, { ViewName: "files", Key: gui.getKey("files.fetch"), - Modifier: gocui.ModNone, Handler: gui.handleGitFetch, Description: gui.Tr.SLocalize("fetch"), }, { ViewName: "", Key: gui.getKey("universal.executeCustomCommand"), - Modifier: gocui.ModNone, Handler: gui.handleCustomCommand, Description: gui.Tr.SLocalize("executeCustomCommand"), }, { ViewName: "files", Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateResetToUpstreamMenu, Description: gui.Tr.SLocalize("viewResetToUpstreamOptions"), }, @@ -499,7 +465,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleBranchPress, Description: gui.Tr.SLocalize("checkout"), }, @@ -507,7 +472,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.createPullRequest"), - Modifier: gocui.ModNone, Handler: gui.handleCreatePullRequestPress, Description: gui.Tr.SLocalize("createPullRequest"), }, @@ -515,7 +479,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.checkoutBranchByName"), - Modifier: gocui.ModNone, Handler: gui.handleCheckoutByName, Description: gui.Tr.SLocalize("checkoutByName"), }, @@ -523,7 +486,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.forceCheckoutBranch"), - Modifier: gocui.ModNone, Handler: gui.handleForceCheckout, Description: gui.Tr.SLocalize("forceCheckout"), }, @@ -531,7 +493,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("universal.new"), - Modifier: gocui.ModNone, Handler: gui.handleNewBranch, Description: gui.Tr.SLocalize("newBranch"), }, @@ -539,7 +500,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleDeleteBranch, Description: gui.Tr.SLocalize("deleteBranch"), }, @@ -547,7 +507,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.rebaseBranch"), - Modifier: gocui.ModNone, Handler: gui.handleRebaseOntoLocalBranch, Description: gui.Tr.SLocalize("rebaseBranch"), }, @@ -555,7 +514,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.mergeIntoCurrentBranch"), - Modifier: gocui.ModNone, Handler: gui.handleMerge, Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"), }, @@ -563,7 +521,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.viewGitFlowOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateGitFlowMenu, Description: gui.Tr.SLocalize("gitFlowOptions"), }, @@ -571,7 +528,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.FastForward"), - Modifier: gocui.ModNone, Handler: gui.handleFastForward, Description: gui.Tr.SLocalize("FastForward"), }, @@ -579,7 +535,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateResetToBranchMenu, Description: gui.Tr.SLocalize("viewResetOptions"), }, @@ -587,15 +542,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"local-branches"}, Key: gui.getKey("branches.renameBranch"), - Modifier: gocui.ModNone, Handler: gui.handleRenameBranch, Description: gui.Tr.SLocalize("renameBranch"), }, { ViewName: "branches", + Contexts: []string{"local-branches"}, + Key: gui.getKey("universal.copyToClipboard"), + Handler: gui.handleClipboardCopyBranch, + Description: gui.Tr.SLocalize("copyBranchNameToClipboard"), + }, + { + ViewName: "branches", Contexts: []string{"tags"}, Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleCheckoutTag, Description: gui.Tr.SLocalize("checkout"), }, @@ -603,7 +563,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"tags"}, Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleDeleteTag, Description: gui.Tr.SLocalize("deleteTag"), }, @@ -611,7 +570,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"tags"}, Key: gui.getKey("branches.pushTag"), - Modifier: gocui.ModNone, Handler: gui.handlePushTag, Description: gui.Tr.SLocalize("pushTag"), }, @@ -619,7 +577,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"tags"}, Key: gui.getKey("universal.new"), - Modifier: gocui.ModNone, Handler: gui.handleCreateTag, Description: gui.Tr.SLocalize("createTag"), }, @@ -627,21 +584,18 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"tags"}, Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateResetToTagMenu, Description: gui.Tr.SLocalize("viewResetOptions"), }, { ViewName: "branches", Key: gui.getKey("universal.nextTab"), - Modifier: gocui.ModNone, Handler: gui.handleNextBranchesTab, Description: gui.Tr.SLocalize("nextTab"), }, { ViewName: "branches", Key: gui.getKey("universal.prevTab"), - Modifier: gocui.ModNone, Handler: gui.handlePrevBranchesTab, Description: gui.Tr.SLocalize("prevTab"), }, @@ -649,7 +603,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"remote-branches"}, Key: gui.getKey("universal.return"), - Modifier: gocui.ModNone, Handler: gui.handleRemoteBranchesEscape, Description: gui.Tr.SLocalize("ReturnToRemotesList"), }, @@ -657,7 +610,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"remote-branches"}, Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateResetToRemoteBranchMenu, Description: gui.Tr.SLocalize("viewResetOptions"), }, @@ -665,21 +617,18 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "branches", Contexts: []string{"remotes"}, Key: gui.getKey("branches.fetchRemote"), - Modifier: gocui.ModNone, Handler: gui.handleFetchRemote, Description: gui.Tr.SLocalize("fetchRemote"), }, { ViewName: "commits", Key: gui.getKey("universal.nextTab"), - Modifier: gocui.ModNone, Handler: gui.handleNextCommitsTab, Description: gui.Tr.SLocalize("nextTab"), }, { ViewName: "commits", Key: gui.getKey("universal.prevTab"), - Modifier: gocui.ModNone, Handler: gui.handlePrevCommitsTab, Description: gui.Tr.SLocalize("prevTab"), }, @@ -687,7 +636,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.squashDown"), - Modifier: gocui.ModNone, Handler: gui.handleCommitSquashDown, Description: gui.Tr.SLocalize("squashDown"), }, @@ -695,7 +643,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.renameCommit"), - Modifier: gocui.ModNone, Handler: gui.handleRenameCommit, Description: gui.Tr.SLocalize("renameCommit"), }, @@ -703,7 +650,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.renameCommitWithEditor"), - Modifier: gocui.ModNone, Handler: gui.handleRenameCommitEditor, Description: gui.Tr.SLocalize("renameCommitEditor"), }, @@ -711,7 +657,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateCommitResetMenu, Description: gui.Tr.SLocalize("resetToThisCommit"), }, @@ -719,7 +664,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.markCommitAsFixup"), - Modifier: gocui.ModNone, Handler: gui.handleCommitFixup, Description: gui.Tr.SLocalize("fixupCommit"), }, @@ -727,7 +671,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.createFixupCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCreateFixupCommit, Description: gui.Tr.SLocalize("createFixupCommit"), }, @@ -735,7 +678,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.squashAboveCommits"), - Modifier: gocui.ModNone, Handler: gui.handleSquashAllAboveFixupCommits, Description: gui.Tr.SLocalize("squashAboveCommits"), }, @@ -743,7 +685,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleCommitDelete, Description: gui.Tr.SLocalize("deleteCommit"), }, @@ -751,7 +692,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.moveDownCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitMoveDown, Description: gui.Tr.SLocalize("moveDownCommit"), }, @@ -759,7 +699,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.moveUpCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitMoveUp, Description: gui.Tr.SLocalize("moveUpCommit"), }, @@ -767,7 +706,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("universal.edit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitEdit, Description: gui.Tr.SLocalize("editCommit"), }, @@ -775,7 +713,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.amendToCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitAmendTo, Description: gui.Tr.SLocalize("amendToCommit"), }, @@ -783,7 +720,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.pickCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitPick, Description: gui.Tr.SLocalize("pickCommit"), }, @@ -791,7 +727,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.revertCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCommitRevert, Description: gui.Tr.SLocalize("revertCommit"), }, @@ -799,15 +734,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.cherryPickCopy"), - Modifier: gocui.ModNone, Handler: gui.handleCopyCommit, Description: gui.Tr.SLocalize("cherryPickCopy"), }, { ViewName: "commits", Contexts: []string{"branch-commits"}, + Key: gui.getKey("universal.copyToClipboard"), + Handler: gui.handleClipboardCopyCommit, + Description: gui.Tr.SLocalize("copyCommitShaToClipboard"), + }, + { + ViewName: "commits", + Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.cherryPickCopyRange"), - Modifier: gocui.ModNone, Handler: gui.handleCopyCommitRange, Description: gui.Tr.SLocalize("cherryPickCopyRange"), }, @@ -815,7 +755,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.pasteCommits"), - Modifier: gocui.ModNone, Handler: gui.HandlePasteCommits, Description: gui.Tr.SLocalize("pasteCommits"), }, @@ -823,7 +762,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("universal.goInto"), - Modifier: gocui.ModNone, Handler: gui.handleSwitchToCommitFilesPanel, Description: gui.Tr.SLocalize("viewCommitFiles"), }, @@ -831,7 +769,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.checkoutCommit"), - Modifier: gocui.ModNone, Handler: gui.handleCheckoutCommit, Description: gui.Tr.SLocalize("checkoutCommit"), }, @@ -839,7 +776,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.tagCommit"), - Modifier: gocui.ModNone, Handler: gui.handleTagCommit, Description: gui.Tr.SLocalize("tagCommit"), }, @@ -847,7 +783,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"branch-commits"}, Key: gui.getKey("commits.resetCherryPick"), - Modifier: gocui.ModNone, Handler: gui.handleResetCherryPick, Description: gui.Tr.SLocalize("resetCherryPick"), }, @@ -855,7 +790,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"reflog-commits"}, Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleCheckoutReflogCommit, Description: gui.Tr.SLocalize("checkoutCommit"), }, @@ -863,28 +797,24 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commits", Contexts: []string{"reflog-commits"}, Key: gui.getKey("commits.viewResetOptions"), - Modifier: gocui.ModNone, Handler: gui.handleCreateReflogResetMenu, Description: gui.Tr.SLocalize("viewResetOptions"), }, { ViewName: "stash", Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleStashApply, Description: gui.Tr.SLocalize("apply"), }, { ViewName: "stash", Key: gui.getKey("stash.popStash"), - Modifier: gocui.ModNone, Handler: gui.handleStashPop, Description: gui.Tr.SLocalize("pop"), }, { ViewName: "stash", Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleStashDrop, Description: gui.Tr.SLocalize("drop"), }, @@ -915,14 +845,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "menu", Key: gui.getKey("universal.return"), - Modifier: gocui.ModNone, Handler: gui.handleMenuClose, Description: gui.Tr.SLocalize("closeMenu"), }, { ViewName: "menu", Key: gui.getKey("universal.quit"), - Modifier: gocui.ModNone, Handler: gui.handleMenuClose, Description: gui.Tr.SLocalize("closeMenu"), }, @@ -935,56 +863,48 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "commitFiles", Key: gui.getKey("universal.return"), - Modifier: gocui.ModNone, Handler: gui.handleSwitchToCommitsPanel, Description: gui.Tr.SLocalize("goBack"), }, { ViewName: "commitFiles", Key: gui.getKey("commitFiles.checkoutCommitFile"), - Modifier: gocui.ModNone, Handler: gui.handleCheckoutCommitFile, Description: gui.Tr.SLocalize("checkoutCommitFile"), }, { ViewName: "commitFiles", Key: gui.getKey("universal.remove"), - Modifier: gocui.ModNone, Handler: gui.handleDiscardOldFileChange, Description: gui.Tr.SLocalize("discardOldFileChange"), }, { ViewName: "commitFiles", Key: gui.getKey("universal.openFile"), - Modifier: gocui.ModNone, Handler: gui.handleOpenOldCommitFile, Description: gui.Tr.SLocalize("openFile"), }, { ViewName: "commitFiles", Key: gui.getKey("universal.select"), - Modifier: gocui.ModNone, Handler: gui.handleToggleFileForPatch, Description: gui.Tr.SLocalize("toggleAddToPatch"), }, { ViewName: "commitFiles", Key: gui.getKey("universal.goInto"), - Modifier: gocui.ModNone, Handler: gui.handleEnterCommitFile, Description: gui.Tr.SLocalize("enterFile"), }, { ViewName: "", Key: gui.getKey("universal.filteringMenu"), - Modifier: gocui.ModNone, Handler: gui.handleCreateFilteringMenuPanel, Description: gui.Tr.SLocalize("openScopingMenu"), }, { ViewName: "", Key: gui.getKey("universal.diffingMenu"), - Modifier: gocui.ModNone, Handler: gui.handleCreateDiffingMenuPanel, Description: gui.Tr.SLocalize("openDiffingMenu"), }, @@ -1011,7 +931,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "main", Contexts: []string{"normal"}, Key: gocui.MouseWheelDown, - Modifier: gocui.ModNone, Handler: gui.scrollDownMain, Description: gui.Tr.SLocalize("ScrollDown"), Alternative: "fn+up", @@ -1020,7 +939 |