CopySelection copies the user's selection to either "primary" or "clipboard"
(target clipboard.Register)
| 144 | // CopySelection copies the user's selection to either "primary" |
| 145 | // or "clipboard" |
| 146 | func (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 |
| 155 | func (c *Cursor) ResetSelection() { |
no test coverage detected