mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
centralise code for copying to clipboard
This commit is contained in:
@ -552,7 +552,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyBranch,
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copyBranchNameToClipboard"),
|
||||
},
|
||||
{
|
||||
@ -765,7 +765,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyCommit,
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||
},
|
||||
{
|
||||
@ -860,6 +860,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Handler: gui.wrappedHandler(gui.exitCherryPickingMode),
|
||||
Description: gui.Tr.SLocalize("resetCherryPick"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{SUB_COMMITS_CONTEXT_KEY},
|
||||
@ -909,6 +916,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Handler: gui.wrappedHandler(gui.exitCherryPickingMode),
|
||||
Description: gui.Tr.SLocalize("resetCherryPick"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{SUB_COMMITS_CONTEXT_KEY},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard),
|
||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "stash",
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
|
Reference in New Issue
Block a user