mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 21:10:42 +02:00
SourceEdit: when file changed on disc: keep topline
git-svn-id: trunk@36226 -
This commit is contained in:
parent
575e24d917
commit
77d9a604b6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user