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

Method right

internal/buffer/loc.go:86–97  ·  view source on GitHub ↗

This moves the location one character to the right

(buf *LineArray)

Source from the content-addressed store, hash-verified

84
85// This moves the location one character to the right
86func (l Loc) right(buf *LineArray) Loc {
87 if l == buf.End() {
88 return Loc{l.X + 1, l.Y}
89 }
90 var res Loc
91 if l.X < util.CharacterCount(buf.LineBytes(l.Y)) {
92 res = Loc{l.X + 1, l.Y}
93 } else {
94 res = Loc{0, l.Y + 1}
95 }
96 return res
97}
98
99// This moves the given location one character to the left
100func (l Loc) left(buf *LineArray) Loc {

Callers 1

MoveLAMethod · 0.95

Calls 3

CharacterCountFunction · 0.92
LineBytesMethod · 0.65
EndMethod · 0.45

Tested by

no test coverage detected