Skip to content

Commit

Permalink
FindReplaceLogic.updateTarget should call endSession on current target
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Apr 24, 2024
1 parent 3c86ecf commit 669d80a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 669d80a

Please sign in to comment.