mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-16 13:59:17 +02:00
codetools: TSourceChangeCache.Begin/EndUpdate comments and clean up
git-svn-id: trunk@41626 -
This commit is contained in:
parent
c6f791deab
commit
945a988824
@ -292,7 +292,7 @@ type
|
||||
|
||||
// source changing
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
function EndUpdate: boolean;
|
||||
function GatherExternalChanges: boolean;
|
||||
property OnGatherExternalChanges: TOnGatherExternalChanges
|
||||
read FOnGatherExternalChanges write FOnGatherExternalChanges;
|
||||
@ -1123,9 +1123,9 @@ begin
|
||||
SourceChangeCache.BeginUpdate;
|
||||
end;
|
||||
|
||||
procedure TCodeToolManager.EndUpdate;
|
||||
function TCodeToolManager.EndUpdate: boolean;
|
||||
begin
|
||||
SourceChangeCache.EndUpdate;
|
||||
Result:=SourceChangeCache.EndUpdate;
|
||||
end;
|
||||
|
||||
function TCodeToolManager.GatherExternalChanges: boolean;
|
||||
|
@ -251,8 +251,8 @@ type
|
||||
procedure RaiseException(const AMessage: string);
|
||||
public
|
||||
BeautifyCodeOptions: TBeautifyCodeOptions;
|
||||
procedure BeginUpdate;
|
||||
function EndUpdate: boolean;
|
||||
procedure BeginUpdate; // use this to delay Apply, must be balanced with EndUpdate
|
||||
function EndUpdate: boolean; // calls Apply
|
||||
property MainScanner: TLinkScanner read FMainScanner write SetMainScanner;
|
||||
property MainScannerNeeded: boolean read FMainScannerNeeded;
|
||||
function Replace(FrontGap, AfterGap: TGapTyp; FromPos, ToPos: integer;
|
||||
@ -1166,7 +1166,7 @@ begin
|
||||
Result:=true;
|
||||
if FUpdateLock<=0 then exit;
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock<=0 then
|
||||
if (FUpdateLock<=0) then
|
||||
Result:=Apply;
|
||||
end;
|
||||
|
||||
|
@ -1020,13 +1020,13 @@ begin
|
||||
NewUsesTerm:=NewUsesTerm+';';
|
||||
if not SourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,InsertPos,InsertPos,
|
||||
NewUsesTerm) then exit;
|
||||
//if not SourceChangeCache.Apply then exit; <- has no effect when FUpdateLock>0
|
||||
end;
|
||||
Result:=true;
|
||||
finally
|
||||
if not Result then
|
||||
SourceChangeCache.Clear;
|
||||
SourceChangeCache.EndUpdate;
|
||||
if not SourceChangeCache.EndUpdate then
|
||||
Result:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user