codetools: fixed inserting first published variable

git-svn-id: trunk@29365 -
This commit is contained in:
mattias 2011-02-03 22:48:34 +00:00
parent bec76993b1
commit 2fa1d11c5c
2 changed files with 5 additions and 2 deletions

View File

@ -5859,6 +5859,7 @@ begin
end;
end else begin
// insert as first variable/proc
//debugln(['TCodeCompletionCodeTool.InsertNewClassParts ',ClassSectionNode.DescAsString,' ',dbgstr(copy(Src,ClassSectionNode.StartPos,ClassSectionNode.EndPos-ClassSectionNode.StartPos))]);
Indent:=GetLineIndent(Src,ClassSectionNode.StartPos)
+ASourceChangeCache.BeautifyCodeOptions.Indent;
InsertPos:=ClassSectionNode.StartPos;
@ -5867,7 +5868,10 @@ begin
then begin
// the first published section has no keyword
if ClassSectionNode.NextBrother<>nil then
Indent:=GetLineIndent(Src,ClassSectionNode.StartPos)
Indent:=GetLineIndent(Src,ClassSectionNode.NextBrother.StartPos)
+ASourceChangeCache.BeautifyCodeOptions.Indent
else
Indent:=GetLineIndent(Src,ClassSectionNode.Parent.StartPos)
+ASourceChangeCache.BeautifyCodeOptions.Indent;
end else if (ClassSectionNode.Desc in (AllClassBaseSections+[ctnClassType]))
then begin

View File

@ -3727,7 +3727,6 @@ begin
// start the first class section (always published)
CreateChildNode;
CurNode.Desc:=ctnClassPublished;
CurNode.StartPos:=CurPos.EndPos; // behind 'class' including the space
if CurPos.Flag=cafEdgedBracketOpen then
ReadGUID;
// parse till "end" of class/object