MCPcopy
hub / github.com/micro-editor/micro / CopySelection

Method CopySelection

internal/buffer/cursor.go:146–152  ·  view source on GitHub ↗

CopySelection copies the user's selection to either "primary" or "clipboard"

(target clipboard.Register)

Source from the content-addressed store, hash-verified

144// CopySelection copies the user's selection to either "primary"
145// or "clipboard"
146func (c *Cursor) CopySelection(target clipboard.Register) {
147 if c.HasSelection() {
148 if target != clipboard.PrimaryReg || c.buf.Settings["useprimary"].(bool) {
149 clipboard.WriteMulti(string(c.GetSelection()), target, c.Num, c.buf.NumCursors())
150 }
151 }
152}
153
154// ResetSelection resets the user's selection
155func (c *Cursor) ResetSelection() {

Callers 6

MousePressMethod · 0.80
MouseReleaseMethod · 0.80
CopyMethod · 0.80
CopyLineMethod · 0.80
CutMethod · 0.80
CutLineMethod · 0.80

Calls 4

HasSelectionMethod · 0.95
GetSelectionMethod · 0.95
WriteMultiFunction · 0.92
NumCursorsMethod · 0.80

Tested by

no test coverage detected