From 8af59c3e6e20b186d9a36220d09e3b9489881686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Tue, 7 Feb 2023 13:10:55 +0100 Subject: [PATCH] Copy remote branch name to clipboard --- docs/keybindings/Keybindings_en.md | 1 + docs/keybindings/Keybindings_ja.md | 1 + docs/keybindings/Keybindings_ko.md | 1 + docs/keybindings/Keybindings_nl.md | 1 + docs/keybindings/Keybindings_pl.md | 1 + docs/keybindings/Keybindings_zh.md | 1 + pkg/gui/keybindings.go | 6 ++++++ 7 files changed, 12 insertions(+) diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 7c6e48e43..565698bf8 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -214,6 +214,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct ## Remote Branches
+  ctrl+o: copy branch name to clipboard
   space: checkout
   n: new branch
   M: merge into currently checked out branch
diff --git a/docs/keybindings/Keybindings_ja.md b/docs/keybindings/Keybindings_ja.md
index 6a9f67b6c..e8de2ca3c 100644
--- a/docs/keybindings/Keybindings_ja.md
+++ b/docs/keybindings/Keybindings_ja.md
@@ -268,6 +268,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
 ## リモートブランチ
 
 
+  ctrl+o: ブランチ名をクリップボードにコピー
   space: チェックアウト
   n: 新しいブランチを作成
   M: 現在のブランチにマージ
diff --git a/docs/keybindings/Keybindings_ko.md b/docs/keybindings/Keybindings_ko.md
index 151f49129..9eea1d343 100644
--- a/docs/keybindings/Keybindings_ko.md
+++ b/docs/keybindings/Keybindings_ko.md
@@ -199,6 +199,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
 ## 원격 브랜치
 
 
+  ctrl+o: 브랜치명을 클립보드에 복사
   space: 체크아웃
   n: 새 브랜치 생성
   M: 현재 브랜치에 병합
diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md
index bdb6b20f7..b1e3a83b9 100644
--- a/docs/keybindings/Keybindings_nl.md
+++ b/docs/keybindings/Keybindings_nl.md
@@ -193,6 +193,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
 ## Remote Branches
 
 
+  ctrl+o: kopieer branch name naar klembord
   space: uitchecken
   n: nieuwe branch
   M: merge in met huidige checked out branch
diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md
index 9f00b4cc0..232034173 100644
--- a/docs/keybindings/Keybindings_pl.md
+++ b/docs/keybindings/Keybindings_pl.md
@@ -191,6 +191,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
 ## Remote Branches
 
 
+  ctrl+o: copy branch name to clipboard
   space: przełącz
   n: nowa gałąź
   M: scal do obecnej gałęzi
diff --git a/docs/keybindings/Keybindings_zh.md b/docs/keybindings/Keybindings_zh.md
index 9bc663783..029c82434 100644
--- a/docs/keybindings/Keybindings_zh.md
+++ b/docs/keybindings/Keybindings_zh.md
@@ -274,6 +274,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
 ## 远程分支
 
 
+  ctrl+o: 将分支名称复制到剪贴板
   space: 检出
   n: 新分支
   M: 合并到当前检出的分支
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index ce935b661..572fa4594 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -211,6 +211,12 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
 			Handler:     self.handleCopySelectedSideContextItemToClipboard,
 			Description: self.c.Tr.LcCopyBranchNameToClipboard,
 		},
+		{
+			ViewName:    "remoteBranches",
+			Key:         opts.GetKey(opts.Config.Universal.CopyToClipboard),
+			Handler:     self.handleCopySelectedSideContextItemToClipboard,
+			Description: self.c.Tr.LcCopyBranchNameToClipboard,
+		},
 		{
 			ViewName:    "commits",
 			Key:         opts.GetKey(opts.Config.Universal.CopyToClipboard),