Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-05-12 19:18:37 +0000
committerMarkus Keller2016-05-12 19:18:37 +0000
commitdbc6765916a40d5d201b0974fa05b9de85bf9667 (patch)
tree243bdb68406555aef3457283cf0576d7677b5ae2 /org.eclipse.ui.workbench.texteditor
parentc2099c0bb0457ff1d5839fcafa8362890c9ad19c (diff)
downloadeclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.tar.gz
eclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.tar.xz
eclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.zip
Bug 492587: Autosave breaks Incremental Find
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java
index 3b0b219927b..bbb1cd23743 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -52,6 +52,7 @@ import org.eclipse.jface.text.TextEvent;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.internal.texteditor.NLSUtility;
+import org.eclipse.ui.keys.IBindingService;
/**
* An incremental find target. Replace is always disabled.
@@ -631,11 +632,21 @@ class IncrementalFindTarget implements IFindReplaceTarget, IFindReplaceTargetExt
@Override
public void focusGained(FocusEvent e) {
- leave();
}
@Override
public void focusLost(FocusEvent e) {
+ IBindingService bindingService= PlatformUI.getWorkbench().getAdapter(IBindingService.class);
+ if (bindingService != null && !bindingService.isKeyFilterEnabled()) {
+ /*
+ * Workaround for bug 492587: Autosave breaks Incremental Find:
+ * We don't want to leave when the Workbench Window temporarily disables controls to
+ * run an IRunnableWithProgress. There's no direct API to know that this happens, but
+ * we can rely on the implementation detail that WorkbenchWindow#run(..) disables the
+ * key filter (and is the only one who does this, except for the Keys preference page).
+ */
+ return;
+ }
leave();
}

Back to the top