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

Method setCursorColumn

texteditor/nav.go:98–109  ·  view source on GitHub ↗

setCursorColumn sets the current target cursor column (cursorColumn) to that of the given position

(pos lexer.Pos)

Source from the content-addressed store, hash-verified

96// setCursorColumn sets the current target cursor column (cursorColumn) to that
97// of the given position
98func (ed *Editor) setCursorColumn(pos lexer.Pos) {
99 if wln := ed.wrappedLines(pos.Ln); wln > 1 {
100 si, ri, ok := ed.wrappedLineNumber(pos)
101 if ok && si > 0 {
102 ed.cursorColumn = ri
103 } else {
104 ed.cursorColumn = pos.Ch
105 }
106 } else {
107 ed.cursorColumn = pos.Ch
108 }
109}
110
111// savePosHistory saves the cursor position in history stack of cursor positions
112func (ed *Editor) savePosHistory(pos lexer.Pos) {

Callers 7

cursorForwardMethod · 0.95
cursorForwardWordMethod · 0.95
cursorBackwardMethod · 0.95
cursorBackwardWordMethod · 0.95
keyInputInsertBracketMethod · 0.95
InsertAtCursorMethod · 0.95
PasteRectMethod · 0.95

Calls 2

wrappedLinesMethod · 0.95
wrappedLineNumberMethod · 0.95

Tested by

no test coverage detected