mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix once and forever accidental deleting by backspace while editing speed search pattern
This commit is contained in:
+17
@@ -55,6 +55,7 @@ import com.intellij.ui.ComponentWithMnemonics;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.ui.components.JBOptionButton;
|
||||
import com.intellij.ui.popup.list.ListPopupImpl;
|
||||
import com.intellij.ui.speedSearch.SpeedSearchSupply;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -140,6 +141,10 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isSpeedSearchEditing(e)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// http://www.jetbrains.net/jira/browse/IDEADEV-12372
|
||||
if (e.getKeyCode() == KeyEvent.VK_CONTROL) {
|
||||
if (e.getID() == KeyEvent.KEY_PRESSED) {
|
||||
@@ -226,6 +231,18 @@ public final class IdeKeyEventDispatcher implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSpeedSearchEditing(KeyEvent e) {
|
||||
int keyCode = e.getKeyCode();
|
||||
if (keyCode == KeyEvent.VK_BACK_SPACE) {
|
||||
Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
|
||||
if (owner instanceof JComponent) {
|
||||
SpeedSearchSupply supply = SpeedSearchSupply.getSupply((JComponent)owner);
|
||||
return supply != null && supply.isPopupActive();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if and only if the <code>component</code> represents
|
||||
* modal context.
|
||||
|
||||
Reference in New Issue
Block a user