SourceEdit: when file changed on disc: keep topline

git-svn-id: trunk@36226 -
This commit is contained in:
martin 2012-03-22 18:02:24 +00:00
parent 575e24d917
commit 77d9a604b6

View File

@ -2239,6 +2239,8 @@ var
StartPos, EndPos, MoveToPos: TPoint;
CodeToolsInSync: Boolean;
i: Integer;
CarXY: TPoint;
TopL: Integer;
begin
{$IFDEF IDE_DEBUG}
debugln(['[TSourceEditor.OnCodeBufferChanged] A ',FIgnoreCodeBufferLock,' ',SrcLogEntry<>nil]);
@ -2247,6 +2249,8 @@ begin
DebugBoss.LockCommandProcessing;
SynEditor.BeginUpdate;
try
CarXY := SynEditor.CaretXY;
TopL := SynEditor.TopLine;
CodeToolsInSync:=not NeedsUpdateCodeBuffer;
if SrcLogEntry<>nil then begin
SynEditor.BeginUndoBlock{$IFDEF SynUndoDebugBeginEnd}('TSourceEditorSharedValues.OnCodeBufferChanged'){$ENDIF};
@ -2310,6 +2314,8 @@ begin
FEditorStampCommitedToCodetools:=TSynEditLines(SynEditor.Lines).TextChangeStamp;
end;
finally
SynEditor.CaretXY := CarXY;
SynEditor.TopLine := TopL;
SynEditor.EndUpdate;
DebugBoss.UnLockCommandProcessing;
end;