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

Method Right

internal/buffer/cursor.go:303–314  ·  view source on GitHub ↗

Right moves the cursor right one cell (if possible) or to the next line if it is at the end

()

Source from the content-addressed store, hash-verified

301// Right moves the cursor right one cell (if possible) or
302// to the next line if it is at the end
303func (c *Cursor) Right() {
304 if c.Loc == c.buf.End() {
305 return
306 }
307 if c.X < util.CharacterCount(c.buf.LineBytes(c.Y)) {
308 c.X++
309 } else {
310 c.Down()
311 c.Start()
312 }
313 c.StoreVisualX()
314}
315
316// Relocate makes sure that the cursor is inside the bounds
317// of the buffer If it isn't, it moves it to be within the

Callers 7

StartOfTextMethod · 0.95
WordRightMethod · 0.95
WordLeftMethod · 0.95
SubWordRightMethod · 0.95
SubWordLeftMethod · 0.95
CursorRightMethod · 0.80
SelectRightMethod · 0.80

Calls 6

DownMethod · 0.95
StartMethod · 0.95
StoreVisualXMethod · 0.95
CharacterCountFunction · 0.92
LineBytesMethod · 0.65
EndMethod · 0.45

Tested by

no test coverage detected