Remove creates a remove text event and executes it
(start, end Loc)
| 203 | |
| 204 | // Remove creates a remove text event and executes it |
| 205 | func (eh *EventHandler) Remove(start, end Loc) { |
| 206 | if start == end { |
| 207 | return |
| 208 | } |
| 209 | start = clamp(start, eh.buf.LineArray) |
| 210 | end = clamp(end, eh.buf.LineArray) |
| 211 | e := &TextEvent{ |
| 212 | C: *eh.cursors[eh.active], |
| 213 | EventType: TextEventRemove, |
| 214 | Deltas: []Delta{{[]byte{}, start, end}}, |
| 215 | Time: time.Now(), |
| 216 | } |
| 217 | eh.DoTextEvent(e, true) |
| 218 | } |
| 219 | |
| 220 | // MultipleReplace creates an multiple insertions executes them |
| 221 | func (eh *EventHandler) MultipleReplace(deltas []Delta) { |
no test coverage detected