CursorRight moves the cursor right
()
| 300 | |
| 301 | // CursorRight moves the cursor right |
| 302 | func (h *BufPane) CursorRight() bool { |
| 303 | if h.Cursor.HasSelection() { |
| 304 | h.Cursor.Deselect(false) |
| 305 | } else { |
| 306 | tabstospaces := h.Buf.Settings["tabstospaces"].(bool) |
| 307 | tabmovement := h.Buf.Settings["tabmovement"].(bool) |
| 308 | if tabstospaces && tabmovement { |
| 309 | tabsize := int(h.Buf.Settings["tabsize"].(float64)) |
| 310 | line := h.Buf.LineBytes(h.Cursor.Y) |
| 311 | if h.Cursor.X+tabsize < util.CharacterCount(line) && util.IsSpaces(line[h.Cursor.X:h.Cursor.X+tabsize]) && util.IsBytesWhitespace(line[0:h.Cursor.X]) { |
| 312 | for i := 0; i < tabsize; i++ { |
| 313 | h.Cursor.Right() |
| 314 | } |
| 315 | } else { |
| 316 | h.Cursor.Right() |
| 317 | } |
| 318 | } else { |
| 319 | h.Cursor.Right() |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | h.Relocate() |
| 324 | return true |
| 325 | } |
| 326 | |
| 327 | // WordRight moves the cursor one word to the right |
| 328 | func (h *BufPane) WordRight() bool { |
nothing calls this directly
no test coverage detected