InsertBytes creates an insert text event and executes it
(start Loc, text []byte)
| 188 | |
| 189 | // InsertBytes creates an insert text event and executes it |
| 190 | func (eh *EventHandler) InsertBytes(start Loc, text []byte) { |
| 191 | if len(text) == 0 { |
| 192 | return |
| 193 | } |
| 194 | start = clamp(start, eh.buf.LineArray) |
| 195 | e := &TextEvent{ |
| 196 | C: *eh.cursors[eh.active], |
| 197 | EventType: TextEventInsert, |
| 198 | Deltas: []Delta{{text, start, Loc{0, 0}}}, |
| 199 | Time: time.Now(), |
| 200 | } |
| 201 | eh.DoTextEvent(e, true) |
| 202 | } |
| 203 | |
| 204 | // Remove creates a remove text event and executes it |
| 205 | func (eh *EventHandler) Remove(start, end Loc) { |
no test coverage detected