replaceLineTexts method

void replaceLineTexts(
  1. List<String> lineTexts
)

Implementation

void replaceLineTexts(List<String> lineTexts) {
  final normalizedLineTexts = lineTexts.isEmpty
      ? const <String>['']
      : List<String>.from(lineTexts, growable: false);
  if (_matchesLineTextRange(
    startLine: 0,
    endLine: _storage.lineCount,
    replacementLineTexts: normalizedLineTexts,
  )) {
    return;
  }
  _storage = _optimizedStorageFromLineTexts(
    normalizedLineTexts,
    revision: _storage.revision + 1,
  );
  _appendSource = null;
}