MCPcopy Create free account
hub / github.com/c-bata/go-prompt / Lines

Method Lines

document.go:375–378  ·  view source on GitHub ↗

Lines returns the array of all the lines.

()

Source from the content-addressed store, hash-verified

373
374// Lines returns the array of all the lines.
375func (d *Document) Lines() []string {
376 // TODO: Cache, because this one is reused very often.
377 return strings.Split(d.Text, "\n")
378}
379
380// LineCount return the number of lines in this document. If the document ends
381// with a trailing \n, that counts as the beginning of a new line.

Callers 4

lineStartIndexesMethod · 0.95
LineCountMethod · 0.95
TestDocument_LinesFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestDocument_LinesFunction · 0.76