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

Function NewBufferFromString

internal/buffer/buffer.go:348–350  ·  view source on GitHub ↗

NewBufferFromString creates a new buffer containing the given string

(text, path string, btype BufType)

Source from the content-addressed store, hash-verified

346
347// NewBufferFromString creates a new buffer containing the given string
348func NewBufferFromString(text, path string, btype BufType) *Buffer {
349 return NewBuffer(strings.NewReader(text), int64(len(text)), path, btype, emptyCommand)
350}
351
352// NewBuffer creates a new buffer from a given reader with a given path
353// Ensure that ReadSettings and InitGlobalSettings have been called before creating

Callers 15

AddTabMethod · 0.92
VSplitActionMethod · 0.92
HSplitActionMethod · 0.92
NewRawPaneFunction · 0.92
InitGlobalsFunction · 0.92
openHelpMethod · 0.92
NewTabCmdMethod · 0.92
NewBufferFunction · 0.92
luaImportMicroBufferFunction · 0.92
checkFunction · 0.85
benchCreateAndCloseFunction · 0.85
benchReadFunction · 0.85

Calls 1

NewBufferFunction · 0.70

Tested by 4

checkFunction · 0.68
benchCreateAndCloseFunction · 0.68
benchReadFunction · 0.68
benchEditFunction · 0.68