Skip to content

Commit

Permalink
add param AKeepScroll to LoadFromFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Oct 2, 2019
1 parent 4cc486b commit 5660b07
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions atsynedit/atsynedit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ TATSynEdit = class(TCustomControl)
property GutterBandEmpty: integer read FGutterBandEmpty write FGutterBandEmpty;
property GutterBandDecor: integer read FGutterBandDecor write FGutterBandDecor;
//files
procedure LoadFromFile(const AFilename: string); virtual;
procedure LoadFromFile(const AFilename: string; AKeepScroll: boolean=false); virtual;
procedure SaveToFile(const AFilename: string); virtual;
//cmd
procedure TextInsertAtCarets(const AText: atString; AKeepCaret,
Expand Down Expand Up @@ -3720,7 +3720,7 @@ function TATSynEdit.ClientHeight: integer;
if Result<1 then Result:= 1;
end;

procedure TATSynEdit.LoadFromFile(const AFilename: string);
procedure TATSynEdit.LoadFromFile(const AFilename: string; AKeepScroll: boolean=false);
begin
DoPaintModeStatic;

Expand All @@ -3731,8 +3731,11 @@ procedure TATSynEdit.LoadFromFile(const AFilename: string);
FWrapInfo.Clear;
FWrapUpdateNeeded:= true;

FScrollHorz.Clear;
FScrollVert.Clear;
if not AKeepScroll then
begin
FScrollHorz.Clear;
FScrollVert.Clear;
end;

BeginUpdate;
try
Expand Down

0 comments on commit 5660b07

Please sign in to comment.