summaryrefslogtreecommitdiffstats
path: root/ui/pager.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/pager.go')
-rw-r--r--ui/pager.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/pager.go b/ui/pager.go
index 0cebdd9..8196761 100644
--- a/ui/pager.go
+++ b/ui/pager.go
@@ -7,6 +7,7 @@ import (
"strings"
"time"
+ "github.com/atotto/clipboard"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/textinput"
"github.com/charmbracelet/bubbles/viewport"
@@ -289,6 +290,14 @@ func (m pagerModel) update(msg tea.Msg) (pagerModel, tea.Cmd) {
return m, openEditor(m.currentDocument.localPath)
}
+ case "c":
+ err := clipboard.WriteAll(m.currentDocument.Body)
+ if err != nil {
+ cmds = append(cmds, m.showStatusMessage("Unable to copy contents"))
+ } else {
+ cmds = append(cmds, m.showStatusMessage("Copied contents"))
+ }
+
case "s":
if m.common.authStatus != authOK {
break
@@ -536,6 +545,7 @@ func (m pagerModel) helpView() (s string) {
col1 := []string{
"g/home go to top",
"G/end go to bottom",
+ "c copy contents",
editOrBlank,
memoOrStash,
"esc back to files",