This moves the location one character to the right
(buf *LineArray)
| 84 | |
| 85 | // This moves the location one character to the right |
| 86 | func (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 |
| 100 | func (l Loc) left(buf *LineArray) Loc { |
no test coverage detected