diff options
author | Julian Weigt <julian.weigt@gmail.com> | 2020-04-26 22:19:41 +0300 |
---|---|---|
committer | Julian Weigt <julian.weigt@gmail.com> | 2020-04-26 22:19:41 +0300 |
commit | b0983a47c9cb8499ca91327cc8b70e7752e911ad (patch) | |
tree | 96cfa9bd41a9a18e6ebe658b7c27f61bfc8c42af /ui/commands.go | |
parent | 0f85fcc3fac833b1635af111e1a7024254fcf3c6 (diff) |
Use github.com/zyedidia/clipboard for clipboard.
Now one can choose as register clipboard and primary.
Diffstat (limited to 'ui/commands.go')
-rw-r--r-- | ui/commands.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/commands.go b/ui/commands.go index 27c9caf..ed853a2 100644 --- a/ui/commands.go +++ b/ui/commands.go @@ -34,7 +34,6 @@ import ( "github.com/lucasb-eyer/go-colorful" "github.com/russross/blackfriday/v2" - "github.com/atotto/clipboard" "maunium.net/go/mautrix" "maunium.net/go/mautrix/event" @@ -179,10 +178,14 @@ func cmdOpen(cmd *Command) { } func cmdCopy(cmd *Command) { - if clipboard.Unsupported { - cmd.Reply("Clipboard unsupported.") + register := strings.Join(cmd.Args, " ") + if len(register) == 0 { + register = "clipboard" + } + if (register == "clipboard" || register == "primary") { + cmd.Room.StartSelecting(SelectCopy, register) } else { - cmd.Room.StartSelecting(SelectCopy, strings.Join(cmd.Args, " ")) + cmd.Reply("Usage: /copy [register], where register is either \"clipboard\" or \"primary\". Defaults to \"clipboard\".") } } |