From d426bca8d5b0372adf36b1bab7344058b46e28ab Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 31 Mar 2019 14:02:51 +0200 Subject: [PATCH] fix upstream reg after adding the selection as search & replace scope --- src/u_search.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/u_search.pas b/src/u_search.pas index e1dc3951..f7d31dd5 100644 --- a/src/u_search.pas +++ b/src/u_search.pas @@ -594,11 +594,16 @@ begin fDoc.OnReplaceText := @replaceEvent else if fFindScope = scSel then begin + fDoc.CaretXY := fDocSelStart; fDoc.OnReplaceText := @replaceInSelEvent; // the event only called if ssoPrompt is included opts += [ssoPrompt]; end; - fDoc.CaretXY := fDocSelStart; + if fFindScope <> scSel then + begin + fDoc.CaretXY := Point(1,1); + fDocSelStop := Point(high(integer), high(integer)); + end; while(true) do begin if fDoc.SearchReplace(fToFind, fReplaceWth, opts) = 0 then