summaryrefslogtreecommitdiffstats
path: root/pkg/gui/global_handlers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 12:07:03 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit438abd6003aff9621f93b8531aa20baad2c8933c (patch)
tree90c3f24a7a604ca057960a23ee4d98d1c95b4e5f /pkg/gui/global_handlers.go
parent442f6cd854d972c3797ca203c8de6943fe81d2ca (diff)
centralise code for copying to clipboard
Diffstat (limited to 'pkg/gui/global_handlers.go')
-rw-r--r--pkg/gui/global_handlers.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go
index b1cedd63b..c2ae9cae8 100644
--- a/pkg/gui/global_handlers.go
+++ b/pkg/gui/global_handlers.go
@@ -178,3 +178,14 @@ func (gui *Gui) fetch(canPromptForCredentials bool) (err error) {
return err
}
+
+func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error {
+ // important to note that this assumes we've selected an item in a side context
+ item := gui.getSideContextSelectedItem()
+
+ if item == nil {
+ return nil
+ }
+
+ return gui.OSCommand.CopyToClipboard(item.ID())
+}