SynEdit: Fix painting in Search and replace / issue #13702

git-svn-id: trunk@19956 -
This commit is contained in:
martin 2009-05-13 17:15:12 +00:00
parent 324981825e
commit 9274d85e5b

View File

@ -6924,7 +6924,7 @@ begin
nReplaceLen := Length(AReplace); nReplaceLen := Length(AReplace);
{$ENDIF} {$ENDIF}
// search while the current search position is inside of the search range // search while the current search position is inside of the search range
if bReplaceAll then IncPaintLock; IncPaintLock;
try try
{$IFDEF SYN_LAZARUS} {$IFDEF SYN_LAZARUS}
//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),'"']);
@ -6953,8 +6953,13 @@ begin
CurReplace:=fTSearch.RegExprReplace; CurReplace:=fTSearch.RegExprReplace;
if bPrompt and Assigned(fOnReplaceText) then begin if bPrompt and Assigned(fOnReplaceText) then begin
EnsureCursorPosVisible; EnsureCursorPosVisible;
nAction := DoOnReplaceText(ASearch,CurReplace, try
ptFoundStart.Y,ptFoundStart.X); DecPaintLock;
nAction := DoOnReplaceText(ASearch,CurReplace,
ptFoundStart.Y,ptFoundStart.X);
finally
IncPaintLock;
end;
if nAction = raCancel then exit; if nAction = raCancel then exit;
end else end else
nAction := raReplace; nAction := raReplace;
@ -6964,7 +6969,6 @@ begin
if nAction = raReplaceAll then begin if nAction = raReplaceAll then begin
if not bReplaceAll then begin if not bReplaceAll then begin
bReplaceAll := TRUE; bReplaceAll := TRUE;
IncPaintLock;
end; end;
bPrompt := False; bPrompt := False;
end; end;
@ -7033,7 +7037,6 @@ begin
if nAction = raReplaceAll then begin if nAction = raReplaceAll then begin
if not bReplaceAll then begin if not bReplaceAll then begin
bReplaceAll := TRUE; bReplaceAll := TRUE;
IncPaintLock;
end; end;
bPrompt := False; bPrompt := False;
end; end;
@ -7053,7 +7056,7 @@ begin
end; end;
{$ENDIF} {$ENDIF}
finally finally
if bReplaceAll then DecPaintLock; DecPaintLock;
end; end;
end; end;