From 2438d7b7cd98338e7712791e813b18c2c17af427 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Tue, 9 Feb 2010 15:59:56 +0300 Subject: [PATCH] fixed [RUBY-5133] Keep last rake search --- .../com/intellij/ide/util/gotoByName/ChooseByNamePopup.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java index 6f19f34de5..7549872216 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java @@ -39,12 +39,16 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP private ChooseByNamePopup(final Project project, final ChooseByNameModel model, final ChooseByNamePopup oldPopup, final PsiElement context, @Nullable final String predefinedText) { - super(project, model, oldPopup != null ? oldPopup.myTextField.getText() : predefinedText, context); + super(project, model, oldPopup != null ? oldPopup.getEnteredText() : predefinedText, context); if (oldPopup != null) { //inherit old focus owner myOldFocusOwner = oldPopup.myPreviouslyFocusedComponent; } } + public String getEnteredText() { + return myTextField.getText(); + } + protected void initUI(final Callback callback, final ModalityState modalityState, boolean allowMultipleSelection) { super.initUI(callback, modalityState, allowMultipleSelection); //LaterInvocator.enterModal(myTextFieldPanel); @@ -130,7 +134,7 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP } if (!chosenElements.isEmpty()){ - final String enteredText = myTextField.getText(); + final String enteredText = getEnteredText(); if (enteredText.indexOf('*') >= 0) { FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.popup.wildcards"); } @@ -235,7 +239,7 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP } private int getLineOrColumn(final boolean line) { - final Matcher matcher = patternToDetectLinesAndColumns.matcher(myTextField.getText()); + final Matcher matcher = patternToDetectLinesAndColumns.matcher(getEnteredText()); if (matcher.matches()) { final int groupNumber = line ? 2:3; try { -- 2.11.4.GIT