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

Method LineCount

document.go:382–384  ·  view source on GitHub ↗

LineCount return the number of lines in this document. If the document ends with a trailing \n, that counts as the beginning of a new line.

()

Source from the content-addressed store, hash-verified

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.
382func (d *Document) LineCount() int {
383 return len(d.Lines())
384}
385
386// TranslateIndexToPosition given an index for the text, return the corresponding (row, col) tuple.
387// (0-based. Returns (0, 0) for index=0.)

Callers 3

lineStartIndexesMethod · 0.95
OnLastLineMethod · 0.95
TestDocument_LineCountFunction · 0.95

Calls 1

LinesMethod · 0.95

Tested by 1

TestDocument_LineCountFunction · 0.76