private boolean shouldSoftWrapsBeForced(@Nullable DocumentEvent event) {
    if (Boolean.FALSE.equals(editor.getUserData(EditorImpl.FORCED_SOFT_WRAPS))) {
      return false;
    }
    Project project = editor.getProject();
    Document document = editor.getDocument();
    if (project != null && PostprocessReformattingAspect.getInstance(project).isDocumentLocked(document)) {
      // Disable checking for files in intermediate states - e.g., for files during refactoring.
      return false;
    }
    int lineWidthLimit = AdvancedSettings.getInt("editor.soft.wrap.force.limit");
    int startLine = event == null ? 0 : document.getLineNumber(event.getOffset());
    int endLine = event == null ? document.getLineCount() - 1 : document.getLineNumber(event.getOffset() + event.getNewLength());
    for (int i = startLine; i <= endLine; i++) {
      if (document.getLineEndOffset(i) - document.getLineStartOffset(i) > lineWidthLimit) {
        return true;
      }
    }
    return false;
  }
private boolean shouldSoftWrapsBeForced(@Nullable DocumentEvent event)