Right moves the cursor right one cell (if possible) or to the next line if it is at the end
()
| 301 | // Right moves the cursor right one cell (if possible) or |
| 302 | // to the next line if it is at the end |
| 303 | func (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 |
no test coverage detected