IDEA-189354 "Find in path" (old style) requires 2 "ESC" pressing to close

This commit is contained in:
Vassiliy.Kudryashov
2018-08-13 19:01:56 +03:00
parent 55b1b429fe
commit 44d3ac03c7
@@ -351,6 +351,26 @@ public class FindDialog extends DialogWrapper implements FindUI {
else action.actionPerformed(e);
}
}.registerCustomShortcutSet(CommonShortcuts.ENTER, comboBox, myDisposable);
DumbAwareAction escAction = new DumbAwareAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
doCancelAction();
}
@Override
public void update(@NotNull AnActionEvent e) {
if (myInputComboBox.isPopupVisible()
|| myReplaceComboBox.isPopupVisible()
|| mySearchContext.isPopupVisible()
|| myDirectoryComboBox.isPopupVisible()
|| myFileFilter.isPopupVisible()
|| myScopeCombo.getComboBox().isPopupVisible()
) {
e.getPresentation().setEnabled(false);
}
}
};
escAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE, this.getRootPane(), myDisposable);
}
}