moveCursorWordRight method

void moveCursorWordRight()

Moves cursor to the end of the next word.

Implementation

void moveCursorWordRight() {
  if (_cursorPosition >= _buffer.length) return;

  final t = text;
  var pos = _cursorPosition;

  // Skip current word
  while (pos < t.length && t[pos] != ' ') {
    pos++;
  }

  // Skip whitespace
  while (pos < t.length && t[pos] == ' ') {
    pos++;
  }

  _cursorPosition = pos;
}