From 7e304b60ad928155ca1bb165ba77be9ebc98d760 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Thu, 5 Feb 2015 20:31:20 +0300 Subject: [PATCH] Move delayed request to update a spotlight to more appropriate place --- .../options/newEditor/SettingsEditor.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java index 1b00e5990983..4a0da5a97736 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsEditor.java @@ -248,21 +248,7 @@ final class SettingsEditor extends AbstractEditor implements DataProvider { } } myFilter.update(filter, false, true); - myTreeView.select(configurable).doWhenProcessed(new Runnable() { - @Override - public void run() { - if (!myDisposed) { - new Alarm().addRequest(new Runnable() { - @Override - public void run() { - if (!myDisposed) { - mySpotlightPainter.updateNow(); - } - } - }, 300); - } - } - }); + myTreeView.select(configurable); Disposer.register(this, myTreeView); } @@ -330,6 +316,16 @@ final class SettingsEditor extends AbstractEditor implements DataProvider { myEditor.getResetAction().setEnabled(myFilter.myContext.isModified(configurable) || exception != null); myEditor.setError(exception); } + if (configurable != null) { + new Alarm().addRequest(new Runnable() { + @Override + public void run() { + if (!myDisposed && mySpotlightPainter != null) { + mySpotlightPainter.updateNow(); + } + } + }, 300); + } } void checkModified(Configurable configurable) {