deleteLines method

bool deleteLines()

Deletes the selected lines, or the current line if there is no selection.

Implementation

bool deleteLines() {
  return _runEditFrame(() {
    _beginHistoryAction(_TextAreaHistoryAction.transform, breakChain: true);
    final result = textDeleteLinesDocument(
      document: _document,
      state: _currentLineStateSnapshot(),
    );
    if (!result.changed) {
      return false;
    }

    _recordUndoSnapshot();
    _applyOffsetCommandResult(result);
    return true;
  });
}