void (@NotNull Runnable runnable) { Disposable parentDisposable = Disposer.newDisposable(); ShRenameAllOccurrencesHandler.getMaxInplaceRenameSegmentsRegistryValue().setValue(-1, parentDisposable); try { runnable.run(); } finally { Disposer.dispose(parentDisposable); } }