mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 05:30:59 +02:00
Fixed bug #8566 - Pretty Format saves file unwantedly
git-svn-id: trunk@10820 -
This commit is contained in:
parent
07f94a00c2
commit
932397fb09
@ -118,7 +118,8 @@ end;
|
||||
Procedure PrettyPrintFile(Sender : TObject);
|
||||
|
||||
Var
|
||||
S1,S2 : TMemoryStream;
|
||||
S1 : TMemoryStream;
|
||||
S2 : TStringStream;
|
||||
E : TSourceEditorInterface;
|
||||
|
||||
begin
|
||||
@ -130,11 +131,11 @@ begin
|
||||
Try
|
||||
E.Lines.SaveToStream(S1);
|
||||
S1.Position:=0;
|
||||
S2:=TMemoryStream.Create;
|
||||
S2:=TStringStream.Create('');
|
||||
Try
|
||||
PrettyPrintStream(S1,S2);
|
||||
S2.Position:=0;
|
||||
E.Lines.LoadFromStream(S2);
|
||||
E.ReplaceLines(0, E.LineCount, S2.DataString);
|
||||
Finally
|
||||
S2.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user