MCPcopy Create free account
hub / github.com/cogentcore/core / validateCursor

Method validateCursor

texteditor/nav.go:27–33  ·  view source on GitHub ↗

validateCursor sets current cursor to a valid cursor position

()

Source from the content-addressed store, hash-verified

25
26// validateCursor sets current cursor to a valid cursor position
27func (ed *Editor) validateCursor() {
28 if ed.Buffer != nil {
29 ed.CursorPos = ed.Buffer.ValidPos(ed.CursorPos)
30 } else {
31 ed.CursorPos = lexer.PosZero
32 }
33}
34
35// wrappedLines returns the number of wrapped lines (spans) for given line number
36func (ed *Editor) wrappedLines(ln int) int {

Callers 15

cursorForwardMethod · 0.95
cursorForwardWordMethod · 0.95
cursorDownMethod · 0.95
cursorPageDownMethod · 0.95
cursorBackwardMethod · 0.95
cursorBackwardWordMethod · 0.95
cursorUpMethod · 0.95
cursorPageUpMethod · 0.95
cursorRecenterMethod · 0.95
cursorStartLineMethod · 0.95
CursorStartDocMethod · 0.95
cursorEndLineMethod · 0.95

Calls 1

ValidPosMethod · 0.80

Tested by

no test coverage detected