From 6945d39f52657c07a6bcb1ae43876ff98a76d95a Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 3 Aug 2011 21:01:32 +0400 Subject: [PATCH] scopes: leave pattern text untouched when pattern is invalid (IDEA-72837 ) --- .../ide/util/scopeChooser/ScopeEditorPanel.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeEditorPanel.java b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeEditorPanel.java index df8137ea1f15..48fb8732323b 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeEditorPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeEditorPanel.java @@ -382,12 +382,14 @@ public class ScopeEditorPanel { public void run() { myIsInUpdate = true; if (updateText) { - final String text = myCurrentScope != null ? myCurrentScope.getText() : ""; - SwingUtilities.invokeLater(new Runnable() { - public void run() { - myPatternField.setText(text); - } - }); + final String text = myCurrentScope != null ? myCurrentScope.getText() : null; + if (text != null) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + myPatternField.setText(text); + } + }); + } } try { if (!myProject.isDisposed()) {