diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 5da50d327f80..1ce37438ccfa 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -127,6 +127,8 @@ public abstract class ChooseByNameBase { protected JBPopup myTextPopup; protected JBPopup myDropdownPopup; + private boolean myClosedByShiftEnter = false; + private static class MatchesComparator implements Comparator { private final String myOriginalPattern; @@ -175,6 +177,10 @@ public abstract class ChooseByNameBase { mySearchInAnyPlace = searchInAnyPlace; } + public boolean isClosedByShiftEnter() { + return myClosedByShiftEnter; + } + /** * Set tool area. The method may be called only before invoke. * @@ -419,6 +425,10 @@ public abstract class ChooseByNameBase { myTextField.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ENTER && (e.getModifiers() & KeyEvent.SHIFT_MASK) != 0) { + myClosedByShiftEnter = true; + close(true); + } if (!myListScrollPane.isVisible()) { return; }