summaryrefslogtreecommitdiffstats
path: root/pkg/gui/branches_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-04-15 20:30:24 +1000
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2020-04-15 10:44:56 +0000
commit2974a57943cc673972bc346b23527a95086ccdfe (patch)
treee527acbd62fbb7c156c3df552ea85f99e55512ea /pkg/gui/branches_panel.go
parentfcdcd1c335974bab0499be5549021e6938653554 (diff)
support copying stuff to clipboard
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r--pkg/gui/branches_panel.go9
1 files changed, 9 insertions, 0 deletions
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)
+}