toggleLinePrefix method

bool toggleLinePrefix(
  1. String prefix, {
  2. bool addSpaceWhenNonEmpty = true,
  3. bool skipBlankLinesWhenChecking = true,
})

Toggles prefix on the current line or selected block.

Implementation

bool toggleLinePrefix(
  String prefix, {
  bool addSpaceWhenNonEmpty = true,
  bool skipBlankLinesWhenChecking = true,
}) {
  final changed = _model.toggleLinePrefix(
    prefix,
    addSpaceWhenNonEmpty: addSpaceWhenNonEmpty,
    skipBlankLinesWhenChecking: skipBlankLinesWhenChecking,
  );
  if (changed) {
    notifyListeners();
  }
  return changed;
}