MCPcopy
hub / github.com/c-bata/go-prompt / CurrentLine

Method CurrentLine

document.go:268–270  ·  view source on GitHub ↗

CurrentLine return the text on the line where the cursor is. (when the input consists of just one line, it equals `text`.

()

Source from the content-addressed store, hash-verified

266// CurrentLine return the text on the line where the cursor is. (when the input
267// consists of just one line, it equals `text`.
268func (d *Document) CurrentLine() string {
269 return d.CurrentLineBeforeCursor() + d.CurrentLineAfterCursor()
270}
271
272// Array pointing to the start indexes of all the lines.
273func (d *Document) lineStartIndexes() []int {

Callers 3

TestDocument_CurrentLineFunction · 0.95

Calls 2

Tested by 2

TestDocument_CurrentLineFunction · 0.76