@NotNull
  Dimension adjust(@NotNull Dimension newPreferredSize, @Nullable Dimension oldPreferredSize, @NotNull EditorImpl editor) {
    if (oldPreferredSize == null || myInsideValidation) {
      return newPreferredSize;
    }
    // Process only width change.
    if (newPreferredSize.height != oldPreferredSize.height) {
      return newPreferredSize;
    }

    stripTimings();
    myTimings.add(System.currentTimeMillis());
    if (myTimings.size() < FREQUENT_SIZE_CHANGES_NUMBER) {
      return newPreferredSize;
    }

    boolean increaseWidth = newPreferredSize.width > oldPreferredSize.width;
    Dimension result;
    if (increaseWidth) {
      final int spaceWidth = EditorUtil.getSpaceWidth(Font.PLAIN, editor);
      newPreferredSize.width += myReserveColumns * spaceWidth;
      myReserveColumns += 3;
      result = newPreferredSize;
    }
    else {
      // Don't reduce preferred size on frequent reduce of the longest document line.
      result = oldPreferredSize;
    }

    scheduleSizeUpdate(editor);
    return result;
  }
@NotNull
  Dimension adjust(@NotNull Dimension newPreferredSize, @Nullable Dimension oldPreferredSize, @NotNull EditorImpl editor)