diff options
author | Markus Keller | 2016-05-12 19:18:37 +0000 |
---|---|---|
committer | Markus Keller | 2016-05-12 19:18:37 +0000 |
commit | dbc6765916a40d5d201b0974fa05b9de85bf9667 (patch) | |
tree | 243bdb68406555aef3457283cf0576d7677b5ae2 /org.eclipse.ui.workbench.texteditor | |
parent | c2099c0bb0457ff1d5839fcafa8362890c9ad19c (diff) | |
download | eclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.tar.gz eclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.tar.xz eclipse.platform.text-dbc6765916a40d5d201b0974fa05b9de85bf9667.zip |
Bug 492587: Autosave breaks Incremental Find
Change-Id: I44fac280f24f2c97a67f3fd70781e4bd5dd86fda
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor')
-rw-r--r-- | org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java | 15 |
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(); } |