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

Method insert

internal/buffer/buffer.go:126–133  ·  view source on GitHub ↗
(pos Loc, value []byte)

Source from the content-addressed store, hash-verified

124}
125
126func (b *SharedBuffer) insert(pos Loc, value []byte) {
127 b.HasSuggestions = false
128 b.LineArray.insert(pos, value)
129 b.setModified()
130
131 inslines := bytes.Count(value, []byte{'\n'})
132 b.MarkModified(pos.Y, pos.Y+inslines)
133}
134
135func (b *SharedBuffer) remove(start, end Loc) []byte {
136 b.HasSuggestions = false

Callers 5

ExecuteTextEventFunction · 0.45
saveToFileMethod · 0.45
TestSplitFunction · 0.45
TestInsertFunction · 0.45
MoveLinesUpMethod · 0.45

Calls 2

setModifiedMethod · 0.95
MarkModifiedMethod · 0.95

Tested by 2

TestSplitFunction · 0.36
TestInsertFunction · 0.36