clipboard

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Data written to the null page is discarded.
	PageNull = PageId(iota)

	// The default page stores the contents of the most recent delete or yank operation.
	PageDefault

	// Output of the last shell command inserted into the document.
	PageShellCmdOutput

	// Named pages "a" through "z".
	PageLetterA
	PageLetterB
	PageLetterC
	PageLetterD
	PageLetterE
	PageLetterF
	PageLetterG
	PageLetterH
	PageLetterI
	PageLetterJ
	PageLetterK
	PageLetterL
	PageLetterM
	PageLetterN
	PageLetterO
	PageLetterP
	PageLetterQ
	PageLetterR
	PageLetterS
	PageLetterT
	PageLetterU
	PageLetterV
	PageLetterW
	PageLetterX
	PageLetterY
	PageLetterZ
)

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C struct {
	// contains filtered or unexported fields
}

C represents a clipboard. The clipboard consists of distinct pages, each of which can store string content.

func New

func New() *C

New constructs a new, empty clipboard.

func (*C) Get

func (c *C) Get(p PageId) PageContent

Get retrieves the contents of a page.

func (*C) Set

func (c *C) Set(p PageId, pc PageContent)

Set stores a string in a page, replacing the prior contents.

type PageContent

type PageContent struct {
	Text     string
	Linewise bool
}

PageContent represents the content of a page in the clipboard.

type PageId

type PageId int

PageId represents a page in the clipboard. This is equivalent to what vim calls a "register".

func PageIdForLetter added in v0.2.0

func PageIdForLetter(r rune) PageId

PageIdForLetter returns the page named by a letter "a" to "z". If the rune is non-alphabetical, this returns the null page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL