()
| 631 | // 2. A sequence of non-blank, non-word characters (punctuation/symbols) |
| 632 | |
| 633 | nextVimWord(): Cursor { |
| 634 | if (this.isAtEnd()) { |
| 635 | return this |
| 636 | } |
| 637 | |
| 638 | let pos = this.offset |
| 639 | const advance = (p: number): number => this.measuredText.nextOffset(p) |
| 640 | |
| 641 | const currentGrapheme = this.graphemeAt(pos) |
| 642 | if (!currentGrapheme) { |
| 643 | return this |
| 644 | } |
| 645 | |
| 646 | if (isVimWordChar(currentGrapheme)) { |
| 647 | while (pos < this.text.length && isVimWordChar(this.graphemeAt(pos))) { |
| 648 | pos = advance(pos) |
| 649 | } |
| 650 | } else if (isVimPunctuation(currentGrapheme)) { |
| 651 | while (pos < this.text.length && isVimPunctuation(this.graphemeAt(pos))) { |
| 652 | pos = advance(pos) |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | while ( |
| 657 | pos < this.text.length && |
| 658 | WHITESPACE_REGEX.test(this.graphemeAt(pos)) |
| 659 | ) { |
| 660 | pos = advance(pos) |
| 661 | } |
| 662 | |
| 663 | return new Cursor(this.measuredText, pos) |
| 664 | } |
| 665 | |
| 666 | endOfVimWord(): Cursor { |
| 667 | if (this.isAtEnd()) { |
no test coverage detected