mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 15:58:37 +02:00
Jedi code format: new indent options for case labels and interface guid.
I borrowed the features and some code from https://github.com/quadroid/jcf-pascal-format
This commit is contained in:
parent
930797ee74
commit
f7293e2477
@ -32,9 +32,11 @@
|
||||
<KeepCommentsWithCodeInClassDef> True </KeepCommentsWithCodeInClassDef>
|
||||
<KeepCommentsWithCodeElsewhere> True </KeepCommentsWithCodeElsewhere>
|
||||
<IndentElse> False </IndentElse>
|
||||
<IndentCaseLabels> True </IndentCaseLabels>
|
||||
<IndentCaseElse> True </IndentCaseElse>
|
||||
<IndentNestedTypes> False </IndentNestedTypes>
|
||||
<IndentVarAndConstInClass> False </IndentVarAndConstInClass>
|
||||
<IndentInterfaceGuid> True </IndentInterfaceGuid>
|
||||
</Indent>
|
||||
<Spaces>
|
||||
<TabsToSpaces> True </TabsToSpaces>
|
||||
|
@ -107,10 +107,12 @@ resourcestring
|
||||
+'comments with code elsewhere';
|
||||
lisIndentExtraIndentForIfElseBlocks = 'Extra Indent for If...Else blocks';
|
||||
lisIndentExtraIndentForCaseElseBlocks = 'Extra Indent for Case...Else blocks';
|
||||
lisIndentExtraIndentForCaseLabels = 'Extra Indent for Case labels';
|
||||
lisIndentIndentForProceduresInLibrary = 'Indent for procedures in program/library';
|
||||
lisIndentIndentForProcedureBody = 'Indent for procedure body';
|
||||
lisIndentIndentNestedTypes = 'Indent nested types';
|
||||
lisIndentIndentVarAndConstInClass = 'Indent var and const in class';
|
||||
lisIndentExtraIndentForInterfaceGuid = 'Extra Indent for interface guid';
|
||||
|
||||
//Blank lines tab
|
||||
lisBLBlankLines = 'Blank Lines';
|
||||
|
@ -648,10 +648,18 @@ msgstr ""
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr ""
|
||||
|
@ -649,10 +649,18 @@ msgstr "Zusätzliche Einrückung für Begin/End in Prozeduren"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Zusätzliche Einrückung bei Case..Else-Blöcken"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Zusätzliche Einrückung bei If..Else-Blöcken"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Einrückung"
|
||||
|
@ -644,10 +644,18 @@ msgstr ""
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr ""
|
||||
|
@ -650,10 +650,18 @@ msgstr "Retrait supplémentaire pour \"begin/end\" dans les procédures"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Retrait supplémentaire dans les blocs \"Case...Else\""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Retrait supplémentaire pour les blocs \"If...Else\""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Indentation"
|
||||
|
@ -651,10 +651,18 @@ msgstr "Extra behúzás a begin/end számára eljárásokban"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Extra behúzás a Case...Else számára"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Extra behúzás az If...Else számára"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Behúzás"
|
||||
|
@ -651,10 +651,18 @@ msgstr "Indentazione extra per begin/end all'interno delle procedure"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Indentazione extra per blocchi Case...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Indentazione extra per blocchi If...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Indentazione"
|
||||
|
@ -650,10 +650,18 @@ msgstr "手続き内での begin/end にインデントを追加する"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "case...else ブロックにインデントを追加する"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "if...else ブロックにインデントを追加する"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "インデント"
|
||||
|
@ -650,10 +650,18 @@ msgstr "Papildoma „begin“/„end“ įtrauka procedūrų viduje"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Papildoma „Case...Else“ blokų įtrauka"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Papildoma „If...Else“ blokų įtrauką"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Įtrauka"
|
||||
|
@ -650,10 +650,18 @@ msgstr ""
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr ""
|
||||
|
@ -628,10 +628,18 @@ msgstr ""
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr ""
|
||||
|
@ -650,10 +650,18 @@ msgstr "Identação extra para \"begin/end\" dentro de procedimento"
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Identação extra para blocos \"Case...Else\""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Identação extra para blocos \"If...Else\""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Identação"
|
||||
|
@ -642,10 +642,18 @@ msgstr "Дополнительный отступ для begin/end в проце
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Дополнительный отступ для блоков Case...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Дополнительный отступ для блоков If...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Отступы"
|
||||
|
@ -653,10 +653,18 @@ msgstr "Додатковий відступ для begin/end в процедур
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr "Додатковий відступ для блоків Case...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr "Додатковий відступ для блоків If...Else"
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "Відступи"
|
||||
|
@ -650,10 +650,18 @@ msgstr ""
|
||||
msgid "Extra Indent for Case...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforcaselabels
|
||||
msgid "Extra Indent for Case labels"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforifelseblocks
|
||||
msgid "Extra Indent for If...Else blocks"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentextraindentforinterfaceguid
|
||||
msgid "Extra Indent for interface guid"
|
||||
msgstr ""
|
||||
|
||||
#: jcfuiconsts.lisindentindentation
|
||||
msgid "Indentation"
|
||||
msgstr "缩进(Indentation)"
|
||||
|
@ -467,6 +467,11 @@ begin
|
||||
if IsRunOnProcDecl(pt) then
|
||||
Inc(liIndentCount);
|
||||
|
||||
// decrease ident for interface guid
|
||||
if (not FormattingSettings.Indent.IndentInterfaceGuid) and
|
||||
(pt.TokenType = ttOpenSquareBracket) and pt.HasParentNode(nInterfaceType, 2) then
|
||||
Dec(liIndentCount);
|
||||
|
||||
lbHasIndentedDecl := True;
|
||||
|
||||
liClassNestingCount := CountClassNesting(pt);
|
||||
@ -577,13 +582,16 @@ begin
|
||||
if pt.Nestings.GetLevel(nlCaseSelector) > 0 then
|
||||
begin
|
||||
liIndentCount := liIndentCount + pt.Nestings.GetLevel(nlCaseSelector);
|
||||
//labels on the same level as `case` statement
|
||||
if (liIndentCount > 0) and (not FormattingSettings.Indent.IndentCaseLabels) then
|
||||
Dec(liIndentCount);
|
||||
// don't indent the case label again
|
||||
if pt.HasParentNode(nCaseLabel, 6) then
|
||||
Dec(liIndentCount)
|
||||
else if (pt.TokenType in [ttElse, ttOtherwise]) and pt.HasParentNode(nElseCase, 1) then
|
||||
Dec(liIndentCount);
|
||||
|
||||
if not FormattingSettings.Indent.IndentCaseElse then
|
||||
if (not FormattingSettings.Indent.IndentCaseElse) and FormattingSettings.Indent.IndentCaseLabels then
|
||||
begin
|
||||
liIndentCount := liIndentCount - pt.CountParentNodes(nElseCase);
|
||||
end;
|
||||
|
@ -50,9 +50,11 @@ type
|
||||
fbKeepCommentsWithCodeInClassDef: boolean;
|
||||
fbKeepCommentsWithCodeElsewhere: boolean;
|
||||
fbIndentElse: Boolean;
|
||||
fbIndentCaseLabels: Boolean;
|
||||
fbIndentCaseElse: Boolean;
|
||||
fbIndentNestedTypes: Boolean;
|
||||
fbIndentVarAndConstInClass: Boolean;
|
||||
fbIndentInterfaceGuid: boolean;
|
||||
|
||||
protected
|
||||
public
|
||||
@ -85,7 +87,9 @@ type
|
||||
Read fbKeepCommentsWithCodeElsewhere Write fbKeepCommentsWithCodeElsewhere;
|
||||
|
||||
property IndentElse: boolean read fbIndentElse write fbIndentElse;
|
||||
property IndentCaseLabels: boolean read fbIndentCaseLabels write fbIndentCaseLabels;
|
||||
property IndentCaseElse: boolean read fbIndentCaseElse write fbIndentCaseElse;
|
||||
property IndentInterfaceGuid: boolean read fbIndentInterfaceGuid write fbIndentInterfaceGuid;
|
||||
|
||||
property IndentNestedTypes: Boolean read fbIndentNestedTypes write fbIndentNestedTypes;
|
||||
property IndentVarAndConstInClass: Boolean read fbIndentVarAndConstInClass write fbIndentVarAndConstInClass;
|
||||
@ -111,9 +115,11 @@ const
|
||||
REG_KEEP_COMMENTS_WITH_CODE_ELSEWHERE = 'KeepCommentsWithCodeElsewhere';
|
||||
|
||||
REG_INDENT_ELSE = 'IndentElse';
|
||||
REG_INDENT_CASE_LABELS = 'IndentCaseLabels';
|
||||
REG_INDENT_CASE_ELSE = 'IndentCaseElse';
|
||||
REG_INDENT_VAR_AND_CONST_IN_CLASS = 'IndentVarAndConstInClass';
|
||||
REG_INDENT_NESTED_TYPES = 'IndentNestedTypes';
|
||||
REG_INDENT_INTERFACE_GUID = 'IndentInterfaceGuid';
|
||||
|
||||
constructor TSetIndent.Create;
|
||||
begin
|
||||
@ -146,10 +152,13 @@ begin
|
||||
pcStream.Read(REG_KEEP_COMMENTS_WITH_CODE_ELSEWHERE, True);
|
||||
|
||||
fbIndentElse := pcStream.Read(REG_INDENT_ELSE, False);
|
||||
fbIndentCaseLabels := pcStream.Read(REG_INDENT_CASE_LABELS, True);
|
||||
fbIndentCaseElse := pcStream.Read(REG_INDENT_CASE_ELSE, True);
|
||||
|
||||
fbIndentNestedTypes := pcStream.Read(REG_INDENT_NESTED_TYPES, False);
|
||||
fbIndentVarAndConstInClass := pcStream.Read(REG_INDENT_VAR_AND_CONST_IN_CLASS, False);
|
||||
fbIndentInterfaceGuid := pcStream.Read(REG_INDENT_INTERFACE_GUID, True);
|
||||
|
||||
end;
|
||||
|
||||
procedure TSetIndent.WriteToStream(const pcOut: TSettingsOutput);
|
||||
@ -173,10 +182,12 @@ begin
|
||||
pcOut.Write(REG_KEEP_COMMENTS_WITH_CODE_ELSEWHERE, fbKeepCommentsWithCodeElsewhere);
|
||||
|
||||
pcOut.Write(REG_INDENT_ELSE, fbIndentElse);
|
||||
pcOut.Write(REG_INDENT_CASE_LABELS, fbIndentCaseLabels);
|
||||
pcOut.Write(REG_INDENT_CASE_ELSE, fbIndentCaseElse);
|
||||
|
||||
pcOut.Write(REG_INDENT_NESTED_TYPES, fbIndentNestedTypes);
|
||||
pcOut.Write(REG_INDENT_VAR_AND_CONST_IN_CLASS, fbIndentVarAndConstInClass);
|
||||
pcOut.Write(REG_INDENT_INTERFACE_GUID, fbIndentInterfaceGuid);
|
||||
end;
|
||||
|
||||
function TSetIndent.SpacesForIndentLevel(const piLevel: integer): integer;
|
||||
|
@ -32,9 +32,11 @@
|
||||
<KeepCommentsWithCodeInClassDef> True </KeepCommentsWithCodeInClassDef>
|
||||
<KeepCommentsWithCodeElsewhere> True </KeepCommentsWithCodeElsewhere>
|
||||
<IndentElse> False </IndentElse>
|
||||
<IndentCaseLabels> True </IndentCaseLabels>
|
||||
<IndentCaseElse> True </IndentCaseElse>
|
||||
<IndentNestedTypes> True </IndentNestedTypes>
|
||||
<IndentVarAndConstInClass> True </IndentVarAndConstInClass>
|
||||
<IndentInterfaceGuid> True </IndentInterfaceGuid>
|
||||
</Indent>
|
||||
<Spaces>
|
||||
<TabsToSpaces> True </TabsToSpaces>
|
||||
|
@ -1,36 +1,38 @@
|
||||
inherited fClarifyIndent: TfClarifyIndent
|
||||
Height = 347
|
||||
object fClarifyIndent: TfClarifyIndent
|
||||
Left = 0
|
||||
Height = 426
|
||||
Top = 0
|
||||
Width = 430
|
||||
ClientHeight = 347
|
||||
ClientHeight = 426
|
||||
ClientWidth = 430
|
||||
TabOrder = 0
|
||||
DesignLeft = 737
|
||||
DesignTop = 299
|
||||
object Label2: TLabel[0]
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = edtIndentSpaces
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 14
|
||||
Top = 9
|
||||
Width = 118
|
||||
Height = 15
|
||||
Top = 10
|
||||
Width = 131
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Block indentation spaces'
|
||||
ParentColor = False
|
||||
end
|
||||
object edtIndentSpaces: TSpinEdit[1]
|
||||
object edtIndentSpaces: TSpinEdit
|
||||
AnchorSideLeft.Control = Label2
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 130
|
||||
Height = 21
|
||||
Left = 143
|
||||
Height = 23
|
||||
Top = 6
|
||||
Width = 50
|
||||
BorderSpacing.Around = 6
|
||||
MaxValue = 12
|
||||
TabOrder = 0
|
||||
end
|
||||
object gbOptions: TGroupBox[2]
|
||||
object gbOptions: TGroupBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = edtIndentSpaces
|
||||
AnchorSideTop.Side = asrBottom
|
||||
@ -39,35 +41,35 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 308
|
||||
Top = 33
|
||||
Height = 385
|
||||
Top = 35
|
||||
Width = 418
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Options'
|
||||
ClientHeight = 308
|
||||
ClientWidth = 418
|
||||
ClientHeight = 365
|
||||
ClientWidth = 414
|
||||
TabOrder = 1
|
||||
object cbIndentBeginEnd: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = eIndentBeginEndSpaces
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Height = 19
|
||||
Top = 8
|
||||
Width = 232
|
||||
Width = 252
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Extra indent for begin/end inside procedures'
|
||||
OnClick = cbIndentBeginEndClick
|
||||
TabOrder = 0
|
||||
OnClick = cbIndentBeginEndClick
|
||||
end
|
||||
object eIndentBeginEndSpaces: TSpinEdit
|
||||
AnchorSideTop.Control = gbOptions
|
||||
AnchorSideRight.Control = gbOptions
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 348
|
||||
Height = 21
|
||||
Left = 344
|
||||
Height = 23
|
||||
Top = 6
|
||||
Width = 50
|
||||
Anchors = [akTop, akRight]
|
||||
@ -82,23 +84,23 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = eFirstLevelIndent
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 35
|
||||
Width = 158
|
||||
Height = 19
|
||||
Top = 37
|
||||
Width = 169
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Different indent for first level'
|
||||
OnClick = cbHasFirstLevelIndentClick
|
||||
TabOrder = 2
|
||||
OnClick = cbHasFirstLevelIndentClick
|
||||
end
|
||||
object eFirstLevelIndent: TSpinEdit
|
||||
AnchorSideTop.Control = eIndentBeginEndSpaces
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = gbOptions
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 348
|
||||
Height = 21
|
||||
Top = 33
|
||||
Left = 344
|
||||
Height = 23
|
||||
Top = 35
|
||||
Width = 50
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 6
|
||||
@ -110,9 +112,9 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = cbHasFirstLevelIndent
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 58
|
||||
Width = 260
|
||||
Height = 19
|
||||
Top = 62
|
||||
Width = 292
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -125,9 +127,9 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = cbKeepWithInProc
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 81
|
||||
Width = 239
|
||||
Height = 19
|
||||
Top = 87
|
||||
Width = 271
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -140,9 +142,9 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = cbKeepWithInGlobals
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 104
|
||||
Width = 281
|
||||
Height = 19
|
||||
Top = 112
|
||||
Width = 317
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -155,9 +157,9 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = cbKeepWithInClassDef
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 127
|
||||
Width = 244
|
||||
Height = 19
|
||||
Top = 137
|
||||
Width = 272
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -170,9 +172,9 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
AnchorSideTop.Control = cbKeepWithElsewhere
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 150
|
||||
Width = 170
|
||||
Height = 19
|
||||
Top = 162
|
||||
Width = 174
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -182,78 +184,108 @@ inherited fClarifyIndent: TfClarifyIndent
|
||||
end
|
||||
object cbIndentCaseElse: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentIfElse
|
||||
AnchorSideTop.Control = cbIndentCaseLabels
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 173
|
||||
Width = 186
|
||||
Height = 19
|
||||
Top = 212
|
||||
Width = 192
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Extra Indent for Case...Else blocks'
|
||||
TabOrder = 9
|
||||
TabOrder = 10
|
||||
end
|
||||
object cbIndentLibraryProcs: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentCaseElse
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 196
|
||||
Width = 168
|
||||
Height = 19
|
||||
Top = 237
|
||||
Width = 181
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Indent for procedures in library'
|
||||
TabOrder = 10
|
||||
TabOrder = 11
|
||||
end
|
||||
object cbIndentProcedureBody: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentLibraryProcs
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 219
|
||||
Width = 146
|
||||
Height = 19
|
||||
Top = 262
|
||||
Width = 157
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Indent for procedure body'
|
||||
TabOrder = 11
|
||||
TabOrder = 12
|
||||
end
|
||||
object cbIndentNestedTypes: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentProcedureBody
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 242
|
||||
Width = 116
|
||||
Height = 19
|
||||
Top = 287
|
||||
Width = 121
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Indent nested types'
|
||||
TabOrder = 12
|
||||
TabOrder = 13
|
||||
end
|
||||
object cbIndentVarAndConstInClass: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentNestedTypes
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 17
|
||||
Top = 265
|
||||
Width = 156
|
||||
Height = 19
|
||||
Top = 312
|
||||
Width = 167
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Indent var and const in class'
|
||||
TabOrder = 13
|
||||
TabOrder = 14
|
||||
end
|
||||
object cbIndentCaseLabels: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentIfElse
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 187
|
||||
Width = 157
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Extra Indent for case labels'
|
||||
TabOrder = 9
|
||||
end
|
||||
object cbIndentInterfaceGuid: TCheckBox
|
||||
AnchorSideLeft.Control = gbOptions
|
||||
AnchorSideTop.Control = cbIndentVarAndConstInClass
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 337
|
||||
Width = 174
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'Extra Indent for interface guid'
|
||||
TabOrder = 15
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -38,6 +38,8 @@ type
|
||||
{ TfClarifyIndent }
|
||||
|
||||
TfClarifyIndent = class(TAbstractIDEOptionsEditor)
|
||||
cbIndentCaseLabels: TCheckBox;
|
||||
cbIndentInterfaceGuid: TCheckBox;
|
||||
Label2: TLabel;
|
||||
edtIndentSpaces: TSpinEdit;
|
||||
gbOptions: TGroupBox;
|
||||
@ -100,10 +102,12 @@ begin
|
||||
lisIndentKeepSingleLineCommentsWithCodeElsewhere;
|
||||
cbIndentIfElse.Caption := lisIndentExtraIndentForIfElseBlocks;
|
||||
cbIndentCaseElse.Caption := lisIndentExtraIndentForCaseElseBlocks;
|
||||
cbIndentCaseLabels.Caption := lisIndentExtraIndentForCaseLabels;
|
||||
cbIndentLibraryProcs.Caption := lisIndentIndentForProceduresInLibrary;
|
||||
cbIndentProcedureBody.Caption := lisIndentIndentForProcedureBody;
|
||||
cbIndentNestedTypes.Caption := lisIndentIndentNestedTypes;
|
||||
cbIndentVarAndConstInClass.Caption := lisIndentIndentVarAndConstInClass;
|
||||
cbIndentInterfaceGuid.Caption := lisIndentExtraIndentForInterfaceGuid;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
@ -127,11 +131,13 @@ begin
|
||||
cbKeepWithInClassDef.Checked := KeepCommentsWithCodeInClassDef;
|
||||
cbKeepWithElsewhere.Checked := KeepCommentsWithCodeElsewhere;
|
||||
cbIndentIfElse.Checked := IndentElse;
|
||||
cbIndentCaseLabels.Checked := IndentCaseLabels;
|
||||
cbIndentCaseElse.Checked := IndentCaseElse;
|
||||
cbIndentProcedureBody.Checked := IndentProcedureBody;
|
||||
|
||||
cbIndentNestedTypes.Checked := IndentNestedTypes;
|
||||
cbIndentVarAndConstInClass.Checked := IndentVarAndConstInClass;
|
||||
cbIndentInterfaceGuid.Checked := IndentInterfaceGuid;
|
||||
end;
|
||||
|
||||
cbIndentBeginEndClick(nil);
|
||||
@ -157,11 +163,13 @@ begin
|
||||
KeepCommentsWithCodeInClassDef := cbKeepWithInClassDef.Checked;
|
||||
KeepCommentsWithCodeElsewhere := cbKeepWithElsewhere.Checked;
|
||||
IndentElse := cbIndentIfElse.Checked;
|
||||
IndentCaseLabels := cbIndentCaseLabels.Checked;
|
||||
IndentCaseElse := cbIndentCaseElse.Checked;
|
||||
IndentProcedureBody := cbIndentProcedureBody.Checked;
|
||||
|
||||
IndentNestedTypes := cbIndentNestedTypes.Checked;
|
||||
IndentVarAndConstInClass := cbIndentVarAndConstInClass.Checked;
|
||||
IndentInterfaceGuid := cbIndentInterfaceGuid.Checked;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user