MCPcopy Index your code
hub / github.com/micro-editor/micro / Left

Method Left

internal/buffer/cursor.go:288–299  ·  view source on GitHub ↗

Left moves the cursor left one cell (if possible) or to the previous line if it is at the beginning

()

Source from the content-addressed store, hash-verified

286// Left moves the cursor left one cell (if possible) or to
287// the previous line if it is at the beginning
288func (c *Cursor) Left() {
289 if c.Loc == c.buf.Start() {
290 return
291 }
292 if c.X > 0 {
293 c.X--
294 } else {
295 c.Up()
296 c.End()
297 }
298 c.StoreVisualX()
299}
300
301// Right moves the cursor right one cell (if possible) or
302// to the next line if it is at the end

Callers 5

WordLeftMethod · 0.95
SubWordRightMethod · 0.95
SubWordLeftMethod · 0.95
CursorLeftMethod · 0.80
SelectLeftMethod · 0.80

Calls 4

UpMethod · 0.95
EndMethod · 0.95
StoreVisualXMethod · 0.95
StartMethod · 0.45

Tested by

no test coverage detected