private @NotNull SearchArea getSearchArea(@NotNull Editor editor, @NotNull FindModel findModel) {
    SearchArea searchArea;
    if (ApplicationManager.getApplication().isDispatchThread()) {
      searchArea = getLocalSearchArea(editor, findModel);
    }
    else {
      CompletableFuture<SearchArea> future = new CompletableFuture<>();
      try {
        SwingUtilities.invokeAndWait(() -> {
          var result = getLocalSearchArea(editor, findModel);
          future.complete(result);
        });
      }
      catch (InterruptedException | InvocationTargetException ignore) {
      }
      searchArea = future.getNow(null);
    }
    if (searchArea != null && searchArea.startOffsets.length > 0) {
      return searchArea;
    }
    else {
      return globalSearchArea;
    }
  }
private @NotNull SearchArea getSearchArea(@NotNull Editor editor, @NotNull FindModel findModel)