From b0983a47c9cb8499ca91327cc8b70e7752e911ad Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Sun, 26 Apr 2020 22:19:41 +0300 Subject: Use github.com/zyedidia/clipboard for clipboard. Now one can choose as register clipboard and primary. --- ui/commands.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui/commands.go') 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\".") } } -- cgit v1.2.3