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

Method GetCursorRightPosition

document.go:334–342  ·  view source on GitHub ↗

GetCursorRightPosition returns relative position for cursor right.

(count int)

Source from the content-addressed store, hash-verified

332
333// GetCursorRightPosition returns relative position for cursor right.
334func (d *Document) GetCursorRightPosition(count int) int {
335 if count < 0 {
336 return d.GetCursorLeftPosition(-count)
337 }
338 if len(d.CurrentLineAfterCursor()) > count {
339 return count
340 }
341 return len(d.CurrentLineAfterCursor())
342}
343
344// GetCursorUpPosition return the relative cursor position (character index) where we would be
345// if the user pressed the arrow-up button.

Callers 3

GetCursorLeftPositionMethod · 0.95
CursorRightMethod · 0.80

Calls 2

GetCursorLeftPositionMethod · 0.95

Tested by 1