void alignToValidBoundaries() {
    Document document = getDocument();
    long alignedRange = TextRangeScalarUtil.shift(toScalarRange(),
    DocumentUtil.isInsideCharacterPair(document, getStartOffset()) ? -1 : 0,
    DocumentUtil.isInsideCharacterPair(document, getEndOffset()) ? -1 : 0);
    if (alignedRange != toScalarRange()) {
      myEditor.getFoldingModel().myComplexDocumentChange = true;
    }
    setRange(alignedRange);
  }
void alignToValidBoundaries()