From 462eece67676ef7ee5d6ea67e3e3d25a4f4ddeb2 Mon Sep 17 00:00:00 2001 From: DomingoGP Date: Thu, 5 Oct 2023 22:27:45 +0200 Subject: [PATCH] Jedi code format: Fix identation and bug in commit 8035014eaffe30c2b71c9c49d4f76b3405b84590 --- components/jcf2/Process/Indent/Indenter.pas | 27 ++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/components/jcf2/Process/Indent/Indenter.pas b/components/jcf2/Process/Indent/Indenter.pas index eba9aec608..7bb0c651f3 100644 --- a/components/jcf2/Process/Indent/Indenter.pas +++ b/components/jcf2/Process/Indent/Indenter.pas @@ -694,20 +694,19 @@ begin end; end; - // last comments in var, const,... sections belongs to the next procedure/function. - if (pt.TokenType=ttComment) and pt.HasParentNode([nTypeSection,nVarSection,nConstSection,nUses]) - and (pt.NextSolidTokenType in ProcedureWords) - and ( not pt.HasParentNode(ObjectBodies + [nRecordType])) - //not followed by a blank line. - and not HasEmptyLineOrDirectiveAfterComments(pt) then - begin - Result:=0; - if FormattingSettings.Indent.IndentLibraryProcs then - begin - if pt.HasParentNode([nLibrary, nProgram]) and (liIndentCount >= 1) then - Result:=1; - end; - end; + // last comments in var, const,... sections belongs to the next procedure/function. + if (pt.TokenType = ttComment) and pt.HasParentNode([nTypeSection, nVarSection, nConstSection, nUses]) and + (pt.NextSolidTokenType in ProcedureWords) and (not pt.HasParentNode(ObjectBodies + [nRecordType])) + //not followed by a blank line. + and not HasEmptyLineOrDirectiveAfterComments(pt) then + begin + Result := 0; + if FormattingSettings.Indent.IndentLibraryProcs then + begin + if pt.HasParentNode([nLibrary, nProgram]) and (liIndentCount >= 1) then + Result := FormattingSettings.Indent.SpacesForIndentLevel(1); + end; + end; end;