deleteTextRect deletes rectangular region of text between start, end defining the upper-left and lower-right corners of a rectangle. Fails if st.Ch >= ed.Ch. Sets the timestamp on resulting text.Edit to now. An Undo record is automatically saved depending on Undo.Off setting.
(st, ed lexer.Pos, signal bool)
| 720 | // Fails if st.Ch >= ed.Ch. Sets the timestamp on resulting text.Edit to now. |
| 721 | // An Undo record is automatically saved depending on Undo.Off setting. |
| 722 | func (tb *Buffer) deleteTextRect(st, ed lexer.Pos, signal bool) *text.Edit { |
| 723 | tb.FileModCheck() |
| 724 | tbe := tb.Lines.DeleteTextRect(st, ed) |
| 725 | if tbe == nil { |
| 726 | return tbe |
| 727 | } |
| 728 | if signal { |
| 729 | tb.signalMods() |
| 730 | } |
| 731 | if tb.Autosave { |
| 732 | go tb.autoSave() |
| 733 | } |
| 734 | return tbe |
| 735 | } |
| 736 | |
| 737 | // insertText is the primary method for inserting text into the buffer. |
| 738 | // It inserts new text at given starting position, optionally signaling |
no test coverage detected