MCPcopy
hub / github.com/micro-editor/micro / StartOfText

Method StartOfText

internal/buffer/cursor.go:115–123  ·  view source on GitHub ↗

StartOfText moves the cursor to the first non-whitespace rune of the line it is on

()

Source from the content-addressed store, hash-verified

113// StartOfText moves the cursor to the first non-whitespace rune of
114// the line it is on
115func (c *Cursor) StartOfText() {
116 c.Start()
117 for util.IsWhitespace(c.RuneUnder(c.X)) {
118 if c.X == util.CharacterCount(c.buf.LineBytes(c.Y)) {
119 break
120 }
121 c.Right()
122 }
123}
124
125// IsStartOfText returns whether the cursor is at the first
126// non-whitespace rune of the line it is on

Callers

nothing calls this directly

Calls 6

StartMethod · 0.95
RuneUnderMethod · 0.95
RightMethod · 0.95
IsWhitespaceFunction · 0.92
CharacterCountFunction · 0.92
LineBytesMethod · 0.65

Tested by

no test coverage detected