diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-04-15 20:30:24 +1000 |
---|---|---|
committer | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2020-04-15 10:44:56 +0000 |
commit | 2974a57943cc673972bc346b23527a95086ccdfe (patch) | |
tree | e527acbd62fbb7c156c3df552ea85f99e55512ea /pkg/gui/branches_panel.go | |
parent | fcdcd1c335974bab0499be5549021e6938653554 (diff) |
support copying stuff to clipboard
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r-- | pkg/gui/branches_panel.go | 9 |
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) +} |