fix #37: make yank portable

This commit is contained in:
Thomas von Dein
2025-01-22 23:12:42 +01:00
parent 82f54c120d
commit e8f4fef41c
5 changed files with 28 additions and 3 deletions

View File

@@ -285,7 +285,7 @@ func yankColumns(conf cfg.Config, data *Tabdata) {
} }
if yank != "" { if yank != "" {
clipboard.Primary = true // unix setprimary()
if err := clipboard.WriteAll(yank); err != nil { if err := clipboard.WriteAll(yank); err != nil {
log.Fatalln("error writing string to clipboard:", err) log.Fatalln("error writing string to clipboard:", err)
} }

8
lib/ya_darwin.go Normal file
View File

@@ -0,0 +1,8 @@
// +build darwin
package lib
import "github.com/atotto/clipboard"
func setprimary() {
}

9
lib/ya_unix.go Normal file
View File

@@ -0,0 +1,9 @@
// +build freebsd linux netbsd openbsd solaris dragonfly
package lib
import "github.com/atotto/clipboard"
func setprimary() {
clipboard.Primary = true
}

8
lib/ya_windows.go Normal file
View File

@@ -0,0 +1,8 @@
// +build windows
package lib
import "github.com/atotto/clipboard"
func setprimary() {
}

View File

@@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ======================================================================== .\" ========================================================================
@@ -133,7 +133,7 @@
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "TABLIZER 1" .IX Title "TABLIZER 1"
.TH TABLIZER 1 "2025-01-15" "1" "User Commands" .TH TABLIZER 1 "2025-01-22" "1" "User Commands"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents. .\" way too many mistakes in technical documents.
.if n .ad l .if n .ad l