diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-05-10 01:39:59 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-05-10 01:39:59 +0300 |
commit | 4e2cbf1e4fc40fb5c78c32567a0622a6ce63eeba (patch) | |
tree | a5b9f273722c1ff712ac328f58298c2f37668e32 /ui/commands.go | |
parent | f9007ae875d8f10e30f010414bc8bf2f9390de13 (diff) | |
parent | 12fb6c9076d0f70ef38f104e2bcf703084d85373 (diff) |
Merge remote-tracking branch 'julianuu/master'
Diffstat (limited to 'ui/commands.go')
-rw-r--r-- | ui/commands.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/commands.go b/ui/commands.go index 961be26..fc86e85 100644 --- a/ui/commands.go +++ b/ui/commands.go @@ -158,6 +158,7 @@ const ( SelectRedact = "redact" SelectDownload = "download" SelectOpen = "open" + SelectCopy = "copy" ) func cmdReply(cmd *Command) { @@ -176,6 +177,18 @@ func cmdOpen(cmd *Command) { cmd.Room.StartSelecting(SelectOpen, strings.Join(cmd.Args, " ")) } +func cmdCopy(cmd *Command) { + register := strings.Join(cmd.Args, " ") + if len(register) == 0 { + register = "clipboard" + } + if (register == "clipboard" || register == "primary") { + cmd.Room.StartSelecting(SelectCopy, register) + } else { + cmd.Reply("Usage: /copy [register], where register is either \"clipboard\" or \"primary\". Defaults to \"clipboard\".") + } +} + func cmdReact(cmd *Command) { if len(cmd.Args) == 0 { cmd.Reply("Usage: /react <reaction>") |