From 5660b074d6129612e3acbacb95518bf7796a82b2 Mon Sep 17 00:00:00 2001 From: Alexey-t Date: Wed, 2 Oct 2019 11:24:07 +0300 Subject: [PATCH] add param AKeepScroll to LoadFromFile --- atsynedit/atsynedit.pas | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/atsynedit/atsynedit.pas b/atsynedit/atsynedit.pas index bf4201db3..9ed24df91 100644 --- a/atsynedit/atsynedit.pas +++ b/atsynedit/atsynedit.pas @@ -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, @@ -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; @@ -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