ProgressIndicator (@NotNull ProgressIndicator progress, @NotNull Disposable parentDisposable) { ApplicationManager.getApplication().addApplicationListener(new ApplicationListener() { @Override public void beforeWriteActionStart(@NotNull Object action) { if (!progress.isCanceled()) { progress.cancel(); } } }, parentDisposable); return progress; }