MCPcopy
hub / github.com/micro-editor/micro / Remove

Method Remove

internal/buffer/eventhandler.go:205–218  ·  view source on GitHub ↗

Remove creates a remove text event and executes it

(start, end Loc)

Source from the content-addressed store, hash-verified

203
204// Remove creates a remove text event and executes it
205func (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
221func (eh *EventHandler) MultipleReplace(deltas []Delta) {

Callers 2

ApplyDiffMethod · 0.95
ReplaceMethod · 0.95

Calls 2

DoTextEventMethod · 0.95
clampFunction · 0.85

Tested by

no test coverage detected