MoveLA moves the cursor n characters to the left or right It moves the cursor left if n is negative
(n int, buf *LineArray)
| 113 | // MoveLA moves the cursor n characters to the left or right |
| 114 | // It moves the cursor left if n is negative |
| 115 | func (l Loc) MoveLA(n int, buf *LineArray) Loc { |
| 116 | if n > 0 { |
| 117 | for i := 0; i < n; i++ { |
| 118 | l = l.right(buf) |
| 119 | } |
| 120 | return l |
| 121 | } |
| 122 | for i := 0; i < util.Abs(n); i++ { |
| 123 | l = l.left(buf) |
| 124 | } |
| 125 | return l |
| 126 | } |
| 127 | |
| 128 | // Diff returns the difference between two locs |
| 129 | func (l Loc) Diff(b Loc, buf *Buffer) int { |