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

Function NewBufferFromStringWithCommand

internal/buffer/buffer.go:343–345  ·  view source on GitHub ↗

NewBufferFromStringWithCommand creates a new buffer containing the given string with a cursor loc and a search text

(text, path string, btype BufType, cmd Command)

Source from the content-addressed store, hash-verified

341// NewBufferFromStringWithCommand creates a new buffer containing the given string
342// with a cursor loc and a search text
343func NewBufferFromStringWithCommand(text, path string, btype BufType, cmd Command) *Buffer {
344 return NewBuffer(strings.NewReader(text), int64(len(text)), path, btype, cmd)
345}
346
347// NewBufferFromString creates a new buffer containing the given string
348func NewBufferFromString(text, path string, btype BufType) *Buffer {

Callers 1

LoadInputFunction · 0.92

Calls 1

NewBufferFunction · 0.70

Tested by

no test coverage detected