Skip to content

Commit

Permalink
fix: use more declarative clipboard names
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 13, 2022
1 parent 3259e65 commit 64534a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions osc52.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ import (
type Clipboard uint

const (
// ClipboardC is the clipboard buffer.
ClipboardC Clipboard = iota
// ClipboardP is the primary clipboard buffer.
ClipboardP
// SystemClipboard is the system clipboard buffer.
SystemClipboard Clipboard = iota
// PrimaryClipboard is the primary clipboard buffer (X11).
PrimaryClipboard
)

// String implements the fmt.Stringer interface for [Clipboard].
func (c Clipboard) String() string {
return []string{
"c", "p", "q", "s", "0", "1", "2", "3", "4", "5", "6", "7",
"c", "p",
}[c]
}

Expand Down Expand Up @@ -98,7 +98,7 @@ func Copy(str string) {

// Copy copies the OSC52 string to the output. This uses the system clipboard buffer.
func (o *Output) Copy(str string) {
o.CopyClipboard(str, ClipboardC)
o.CopyClipboard(str, SystemClipboard)
}

// CopyPrimary copies the OSC52 string to the output. This uses the primary clipboard buffer.
Expand All @@ -108,7 +108,7 @@ func CopyPrimary(str string) {

// CopyPrimary copies the OSC52 string to the output. This uses the primary clipboard buffer.
func (o *Output) CopyPrimary(str string) {
o.CopyClipboard(str, ClipboardP)
o.CopyClipboard(str, PrimaryClipboard)
}

// CopyClipboard copies the OSC52 string to the output. This uses the passed clipboard buffer.
Expand Down

0 comments on commit 64534a3

Please sign in to comment.