indentSelection method

void indentSelection(
  1. bool isIncrease
)

Implementation

void indentSelection(bool isIncrease) {
  final indent = getSelectionStyle().attributes[Attribute.indent.key];
  if (indent == null) {
    if (isIncrease) {
      formatSelection(Attribute.indentL1);
    }
    return;
  }
  if (indent.value == 1 && !isIncrease) {
    formatSelection(Attribute.clone(Attribute.indentL1, null));
    return;
  }
  if (isIncrease) {
    formatSelection(Attribute.getIndentLevel(indent.value + 1));
    return;
  }
  formatSelection(Attribute.getIndentLevel(indent.value - 1));
}