mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:39:15 +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);
|
Procedure PrettyPrintFile(Sender : TObject);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
S1,S2 : TMemoryStream;
|
S1 : TMemoryStream;
|
||||||
|
S2 : TStringStream;
|
||||||
E : TSourceEditorInterface;
|
E : TSourceEditorInterface;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -130,11 +131,11 @@ begin
|
|||||||
Try
|
Try
|
||||||
E.Lines.SaveToStream(S1);
|
E.Lines.SaveToStream(S1);
|
||||||
S1.Position:=0;
|
S1.Position:=0;
|
||||||
S2:=TMemoryStream.Create;
|
S2:=TStringStream.Create('');
|
||||||
Try
|
Try
|
||||||
PrettyPrintStream(S1,S2);
|
PrettyPrintStream(S1,S2);
|
||||||
S2.Position:=0;
|
S2.Position:=0;
|
||||||
E.Lines.LoadFromStream(S2);
|
E.ReplaceLines(0, E.LineCount, S2.DataString);
|
||||||
Finally
|
Finally
|
||||||
S2.Free;
|
S2.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user