WordRight moves the cursor one word to the right
()
| 410 | |
| 411 | // WordRight moves the cursor one word to the right |
| 412 | func (c *Cursor) WordRight() { |
| 413 | if c.X == util.CharacterCount(c.buf.LineBytes(c.Y)) { |
| 414 | c.Right() |
| 415 | return |
| 416 | } |
| 417 | for util.IsWhitespace(c.RuneUnder(c.X)) { |
| 418 | if c.X == util.CharacterCount(c.buf.LineBytes(c.Y)) { |
| 419 | return |
| 420 | } |
| 421 | c.Right() |
| 422 | } |
| 423 | if util.IsNonWordChar(c.RuneUnder(c.X)) && !util.IsWhitespace(c.RuneUnder(c.X)) && |
| 424 | util.IsNonWordChar(c.RuneUnder(c.X+1)) { |
| 425 | for util.IsNonWordChar(c.RuneUnder(c.X)) && !util.IsWhitespace(c.RuneUnder(c.X)) { |
| 426 | if c.X == util.CharacterCount(c.buf.LineBytes(c.Y)) { |
| 427 | return |
| 428 | } |
| 429 | c.Right() |
| 430 | } |
| 431 | return |
| 432 | } |
| 433 | c.Right() |
| 434 | for util.IsWordChar(c.RuneUnder(c.X)) { |
| 435 | if c.X == util.CharacterCount(c.buf.LineBytes(c.Y)) { |
| 436 | return |
| 437 | } |
| 438 | c.Right() |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | // WordLeft moves the cursor one word to the left |
| 443 | func (c *Cursor) WordLeft() { |
nothing calls this directly
no test coverage detected