@Override
    protected void changedUpdateImpl(@NotNull DocumentEvent e) {
      super.changedUpdateImpl(e);
      if (isValid()) {
        alignToSurrogatePairBoundaries();
      }
      if (endVirtualOffset > 0 && isValid()) {
        Document document = e.getDocument();
        int startAfter = intervalStart();
        int endAfter = intervalEnd();
        if (!DocumentUtil.isAtLineEnd(endAfter, document) || document.getLineNumber(startAfter) != document.getLineNumber(endAfter)) {
          resetVirtualSelection();
        }
      }
    }
@Override
    protected void changedUpdateImpl(@NotNull DocumentEvent e)