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

Method cursorEndDoc

texteditor/nav.go:562–573  ·  view source on GitHub ↗

cursorEndDoc moves the cursor to the end of the text, updating selection if select mode is active

()

Source from the content-addressed store, hash-verified

560// cursorEndDoc moves the cursor to the end of the text, updating selection if
561// select mode is active
562func (ed *Editor) cursorEndDoc() {
563 ed.validateCursor()
564 org := ed.CursorPos
565 ed.CursorPos.Ln = max(ed.NumLines-1, 0)
566 ed.CursorPos.Ch = ed.Buffer.LineLen(ed.CursorPos.Ln)
567 ed.cursorColumn = ed.CursorPos.Ch
568 ed.setCursor(ed.CursorPos)
569 ed.scrollCursorToBottom()
570 ed.renderCursor(true)
571 ed.cursorSelect(org)
572 ed.NeedsRender()
573}
574
575// todo: ctrl+backspace = delete word
576// shift+arrow = select

Callers 1

keyInputMethod · 0.95

Calls 7

validateCursorMethod · 0.95
setCursorMethod · 0.95
scrollCursorToBottomMethod · 0.95
renderCursorMethod · 0.95
cursorSelectMethod · 0.95
LineLenMethod · 0.80
NeedsRenderMethod · 0.80

Tested by

no test coverage detected