replace method

void replace(
  1. String replacement
)

Replaces the currently selected match with replacement.

Implementation

void replace(String replacement) {
  if (_currentMatchIndex < 0 || _currentMatchIndex >= _matches.length) return;

  final match = _matches[_currentMatchIndex];
  _codeController.replaceRange(match.start, match.end, replacement);
}