insertText is the primary method for inserting text, at given starting position. Sets the timestamp on resulting Edit to now. An Undo record is automatically saved depending on Undo.Off setting.
(st lexer.Pos, text []byte)
| 957 | // at given starting position. Sets the timestamp on resulting Edit to now. |
| 958 | // An Undo record is automatically saved depending on Undo.Off setting. |
| 959 | func (ls *Lines) insertText(st lexer.Pos, text []byte) *Edit { |
| 960 | tbe := ls.insertTextImpl(st, text) |
| 961 | ls.saveUndo(tbe) |
| 962 | return tbe |
| 963 | } |
| 964 | |
| 965 | func (ls *Lines) insertTextImpl(st lexer.Pos, text []byte) *Edit { |
| 966 | if len(text) == 0 { |
no test coverage detected