PasteRect inserts text from the clipboard at current cursor position
()
| 421 | |
| 422 | // PasteRect inserts text from the clipboard at current cursor position |
| 423 | func (ed *Editor) PasteRect() { |
| 424 | if editorClipboardRect == nil { |
| 425 | return |
| 426 | } |
| 427 | ce := editorClipboardRect.Clone() |
| 428 | nl := ce.Reg.End.Ln - ce.Reg.Start.Ln |
| 429 | nch := ce.Reg.End.Ch - ce.Reg.Start.Ch |
| 430 | ce.Reg.Start.Ln = ed.CursorPos.Ln |
| 431 | ce.Reg.End.Ln = ed.CursorPos.Ln + nl |
| 432 | ce.Reg.Start.Ch = ed.CursorPos.Ch |
| 433 | ce.Reg.End.Ch = ed.CursorPos.Ch + nch |
| 434 | tbe := ed.Buffer.insertTextRect(ce, EditSignal) |
| 435 | |
| 436 | pos := tbe.Reg.End |
| 437 | ed.SetCursorShow(pos) |
| 438 | ed.setCursorColumn(ed.CursorPos) |
| 439 | ed.savePosHistory(ed.CursorPos) |
| 440 | ed.NeedsRender() |
| 441 | } |
| 442 | |
| 443 | // ReCaseSelection changes the case of the currently selected text. |
| 444 | // Returns the new text; empty if nothing selected. |
nothing calls this directly
no test coverage detected