From 669d80ae86c63e422021ab1050f483385dba4f20 Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Wed, 24 Apr 2024 10:48:57 +0200 Subject: [PATCH] FindReplaceLogic.updateTarget should call endSession on current target --- .../ui/internal/findandreplace/FindReplaceLogic.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java index b35bc549807..82505f49ee9 100644 --- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java +++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java @@ -588,12 +588,11 @@ public void updateTarget(IFindReplaceTarget newTarget, boolean canEditTarget) { this.isTargetEditable = canEditTarget; if (this.target != newTarget) { - if (newTarget != null && newTarget instanceof IFindReplaceTargetExtension) - ((IFindReplaceTargetExtension) newTarget).endSession(); + if (this.target instanceof IFindReplaceTargetExtension) + ((IFindReplaceTargetExtension) this.target).endSession(); this.target = newTarget; - if (newTarget != null) - isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3; + isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3; if (newTarget instanceof IFindReplaceTargetExtension) { ((IFindReplaceTargetExtension) newTarget).beginSession();