CopyRect copies any selected text to the clipboard, and returns that text, optionally resetting the current selection
(reset bool)
| 404 | // CopyRect copies any selected text to the clipboard, and returns that text, |
| 405 | // optionally resetting the current selection |
| 406 | func (ed *Editor) CopyRect(reset bool) *text.Edit { |
| 407 | tbe := ed.Buffer.RegionRect(ed.SelectRegion.Start, ed.SelectRegion.End) |
| 408 | if tbe == nil { |
| 409 | return nil |
| 410 | } |
| 411 | cb := tbe.ToBytes() |
| 412 | ed.Clipboard().Write(mimedata.NewTextBytes(cb)) |
| 413 | editorClipboardRect = tbe |
| 414 | if reset { |
| 415 | ed.SelectReset() |
| 416 | } |
| 417 | ed.savePosHistory(ed.CursorPos) |
| 418 | ed.NeedsRender() |
| 419 | return tbe |
| 420 | } |
| 421 | |
| 422 | // PasteRect inserts text from the clipboard at current cursor position |
| 423 | func (ed *Editor) PasteRect() { |
nothing calls this directly
no test coverage detected