IDE: not beautifying uses section of package main source, bug #11660

git-svn-id: trunk@15876 -
This commit is contained in:
mattias 2008-07-26 16:49:14 +00:00
parent c7b7a0b503
commit 6f64b8639c
2 changed files with 13 additions and 12 deletions

View File

@ -447,7 +447,7 @@ begin
NewUsesTerm:=NewUnitName;
if NewUnitInFile<>'' then
NewUsesTerm:=NewUsesTerm+' in '''+NewUnitInFile+'''';
//
// Note: do not use beautifier, unit names are case sensitive
if ReplacementNeedsLineEnd(Src,UnitPos.StartPos,UnitPos.EndPos,
length(NewUsesTerm),SourceChangeCache.BeautifyCodeOptions.LineLength) then
begin

View File

@ -49,7 +49,7 @@ uses
Classes, SysUtils, FileProcs, FileUtil, LCLProc, Forms, Controls, Dialogs,
// codetools
AVL_Tree, Laz_XMLCfg, DefineTemplates, CodeCache, BasicCodeTools,
CodeToolManager,
SourceChanger, CodeToolManager,
// IDEIntf,
SrcEditorIntf, IDEExternToolIntf, IDEDialogs, IDEMsgIntf, PackageIntf,
LazIDEIntf,
@ -3173,6 +3173,7 @@ var
NeedsRegisterProcCall: boolean;
CurSrcUnitName: String;
NewShortenSrc: String;
BeautifyCodeOptions: TBeautifyCodeOptions;
begin
{$IFDEF VerbosePkgCompile}
debugln('TLazPackageGraph.SavePackageMainSource A');
@ -3263,28 +3264,28 @@ begin
end;
// create source
BeautifyCodeOptions:=CodeToolBoss.SourceChangeCache.BeautifyCodeOptions;
HeaderSrc:=lisPkgMangThisSourceIsOnlyUsedToCompileAndInstallThePackage;
HeaderSrc:= '{ '
+lisPkgMangThisFileWasAutomaticallyCreatedByLazarusDoNotEdit+e
+lisPkgMangThisSourceIsOnlyUsedToCompileAndInstallThePackage+e
+' '+lisPkgMangThisSourceIsOnlyUsedToCompileAndInstallThePackage+e
+' }'+e+e;
Src:='unit '+APackage.Name+';'+e
Src:=HeaderSrc
+'unit '+APackage.Name+';'+e
+e
+'interface'+e
+e;
Src:=BeautifyCodeOptions.BeautifyStatement(Src,0);
if UsedUnits<>'' then
Src:=Src
+'uses'+e
+' '+UsedUnits+';'+e
+BreakString('uses'+e+UsedUnits+';',
BeautifyCodeOptions.LineLength,BeautifyCodeOptions.Indent)+e
+e;
Src:=Src
+'implementation'+e
Src:=Src+BeautifyCodeOptions.BeautifyStatement(
'implementation'+e
+e
+RegistrationCode
+'end.'+e;
Src:=CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.
BeautifyStatement(Src,0);
Src:=HeaderSrc+Src;
+'end.'+e,0);
// check if old code is already uptodate
Result:=LoadCodeBuffer(CodeBuffer,SrcFilename,[lbfQuiet,lbfCheckIfText,