mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 22:30:28 +02:00
SynEdit: search/replace, use undo-group if replace all with no user prompt
git-svn-id: trunk@39809 -
This commit is contained in:
parent
25305c11d4
commit
fa3535fa07
@ -7150,6 +7150,7 @@ begin
|
|||||||
fTSearch.Backwards:=bBackward;
|
fTSearch.Backwards:=bBackward;
|
||||||
// search while the current search position is inside of the search range
|
// search while the current search position is inside of the search range
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
|
BeginUndoBlock;
|
||||||
try
|
try
|
||||||
ptFoundStartSel.y := -1;
|
ptFoundStartSel.y := -1;
|
||||||
//DebugLn(['TCustomSynEdit.SearchReplace ptStart=',dbgs(ptStart),' ptEnd=',dbgs(ptEnd),' ASearch="',dbgstr(ASearch),'" AReplace="',dbgstr(AReplace),'"']);
|
//DebugLn(['TCustomSynEdit.SearchReplace ptStart=',dbgs(ptStart),' ptEnd=',dbgs(ptEnd),' ASearch="',dbgstr(ASearch),'" AReplace="',dbgstr(AReplace),'"']);
|
||||||
@ -7179,11 +7180,13 @@ begin
|
|||||||
SetFoundCaretAndSel;
|
SetFoundCaretAndSel;
|
||||||
EnsureCursorPosVisible;
|
EnsureCursorPosVisible;
|
||||||
try
|
try
|
||||||
|
EndUndoBlock;
|
||||||
DecPaintLock;
|
DecPaintLock;
|
||||||
nAction := DoOnReplaceText(ASearch,CurReplace,
|
nAction := DoOnReplaceText(ASearch,CurReplace,
|
||||||
ptFoundStart.Y,ptFoundStart.X);
|
ptFoundStart.Y,ptFoundStart.X);
|
||||||
finally
|
finally
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
|
BeginUndoBlock
|
||||||
end;
|
end;
|
||||||
if nAction = raCancel then exit;
|
if nAction = raCancel then exit;
|
||||||
end else
|
end else
|
||||||
@ -7227,6 +7230,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
SetFoundCaretAndSel;
|
SetFoundCaretAndSel;
|
||||||
|
EndUndoBlock;
|
||||||
DecPaintLock;
|
DecPaintLock;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user