diff --git a/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg b/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg
index b3382ae61a..07840542a6 100644
--- a/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg
+++ b/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg
@@ -37,6 +37,7 @@
False
False
True
+ 0
True
diff --git a/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas b/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas
index 7cb7fc200d..db45f65e99 100644
--- a/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas
+++ b/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas
@@ -113,6 +113,12 @@ resourcestring
lisIndentIndentNestedTypes = 'Indent nested types';
lisIndentIndentVarAndConstInClass = 'Indent var and const in class';
lisIndentExtraIndentForInterfaceGuid = 'Extra Indent for interface GUID';
+ lisIndentLabels = 'Indent labels';
+ lisIndentLabelsStatement = 'Indent statement';
+ lisIndentLabelsDontIndent = 'Don''t indent';
+ lisIndentLabelsIndentPrevLevel = 'Indent to prior level';
+ lisIndentLabelslIndentToProcedure = 'Indent to procedure level';
+ lisIndentLabelsIndentX0 = 'Indent to first column position';
//Blank lines tab
lisBLBlankLines = 'Blank Lines';
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po
index 84039c3b18..1c24df3984 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po
@@ -696,6 +696,30 @@ msgstr ""
msgid "Keep single-line comments with code in procedures"
msgstr ""
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr ""
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po
index d5bd014f05..777c22c090 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po
@@ -700,6 +700,30 @@ msgstr "Einzeilige Kommentare in Globals mit dem Quelltext zusammenhalten"
msgid "Keep single-line comments with code in procedures"
msgstr "Einzeilige Kommentare in Prozeduren mit dem Quelltext zusammenhalten"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Einstellungen"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po
index 7ac668581a..7b24c0c02f 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po
@@ -692,6 +692,30 @@ msgstr ""
msgid "Keep single-line comments with code in procedures"
msgstr ""
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr ""
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po
index 3747a9b879..0010d225c8 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po
@@ -700,6 +700,30 @@ msgstr "Conserver une seule ligne de commentaires avec le code"
msgid "Keep single-line comments with code in procedures"
msgstr "Garder une seule ligne de commentaires avec le code dans les procédures"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Options"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po
index 5e55250ff7..99a42a4ac9 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po
@@ -701,6 +701,30 @@ msgstr "Az egysoros megjegyzések együtt tartása a globális kóddal"
msgid "Keep single-line comments with code in procedures"
msgstr "Az egysoros megjegyzések együtt tartása az eljárásban lévő kóddal"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Beállítások"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po
index 489e83195d..1a686ba416 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po
@@ -701,6 +701,30 @@ msgstr "Mantieni codice e commenti monolinea nei globali"
msgid "Keep single-line comments with code in procedures"
msgstr "Mantieni codice e commenti monolinea nelle procedure"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Opzioni"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po
index ec452decea..99b2883cdc 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po
@@ -700,6 +700,30 @@ msgstr "グローバル内の 1 行コメントをコードに合わせる"
msgid "Keep single-line comments with code in procedures"
msgstr "手続き内の 1 行コメントをコードに合わせる"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "オプション"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po
index 50c0329d8b..e8c94e2dcb 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po
@@ -700,6 +700,30 @@ msgstr "Kodo „globaliniuose“ komentarai turi būti vienos eilutės"
msgid "Keep single-line comments with code in procedures"
msgstr "Kodo procedūrose komentarai turi būti vienos eilutės"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Parinktys"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po
index c4e2ebd869..2509ecc783 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po
@@ -698,6 +698,30 @@ msgstr ""
msgid "Keep single-line comments with code in procedures"
msgstr ""
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Opcje"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot
index 9f6d0269d1..43171ff740 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot
@@ -676,6 +676,30 @@ msgstr ""
msgid "Keep single-line comments with code in procedures"
msgstr ""
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr ""
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po
index 0ae7abe102..7ba8bfba45 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po
@@ -700,6 +700,30 @@ msgstr "Manter uma única linha de código com comentários em globais"
msgid "Keep single-line comments with code in procedures"
msgstr "Manter uma única linha de código com comentários em procedimentos"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Opções"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po
index 67733e95a3..c33c869991 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po
@@ -690,6 +690,30 @@ msgstr "Оставлять однострочные комментарии с к
msgid "Keep single-line comments with code in procedures"
msgstr "Оставлять однострочные комментарии с кодом в процедурах"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Параметры"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po
index b4ca3e0b18..eb4aa10f97 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po
@@ -701,6 +701,30 @@ msgstr "Залишати однорядкові коментарі з кодом
msgid "Keep single-line comments with code in procedures"
msgstr "Залишати однорядкові коментарі з кодом в процедурах"
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "Параметри"
diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po
index 9b7069ee59..81d7f23e2b 100644
--- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po
+++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po
@@ -698,6 +698,30 @@ msgstr ""
msgid "Keep single-line comments with code in procedures"
msgstr ""
+#: jcfuiconsts.lisindentlabels
+msgid "Indent labels"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsdontindent
+msgid "Don't indent"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentprevlevel
+msgid "Indent to prior level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsindentx0
+msgid "Indent to first column position"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelslindenttoprocedure
+msgid "Indent to procedure level"
+msgstr ""
+
+#: jcfuiconsts.lisindentlabelsstatement
+msgid "Indent statement"
+msgstr ""
+
#: jcfuiconsts.lisindentoptions
msgid "Options"
msgstr "选项"
diff --git a/components/jcf2/Process/Indent/Indenter.pas b/components/jcf2/Process/Indent/Indenter.pas
index 197660b899..ff428af012 100644
--- a/components/jcf2/Process/Indent/Indenter.pas
+++ b/components/jcf2/Process/Indent/Indenter.pas
@@ -714,10 +714,37 @@ begin
Inc(liIndentCount);
// indent statement after label
- if ( not lbHasIndentedRunOnLine) and
- (pt.Nestings.GetLevel(nlStatementLabel) > 0) and
- ( not pt.HasParentNode(nStatementLabel)) then
- Inc(liIndentCount);
+ if (not lbHasIndentedRunOnLine) and (pt.Nestings.GetLevel(nlStatementLabel) > 0) then
+ begin
+ if (not pt.HasParentNode(nStatementLabel)) then
+ begin
+ if FormattingSettings.Indent.IndentLabels = eLabelIndentStatement then
+ Inc(liIndentCount);
+ end
+ else
+ begin
+ case FormattingSettings.Indent.IndentLabels of
+ eLabelIndentStatement: ;
+ eLabelIndentDontIndent: {keep indent};
+ eLabelIndentPrevLevel:
+ begin
+ if liIndentCount > 0 then
+ Dec(liIndentCount);
+ end;
+ eLabelIndentToProcedure:
+ begin
+ if liIndentCount = 1 then
+ liIndentCount := 0 // program or library top level procs
+ else
+ liIndentCount := pt.Nestings.GetLevel(nlStatementLabel);
+ end;
+ eLabelIndentX0:
+ begin
+ liIndentCount := 0;
+ end;
+ end;
+ end;
+ end;
// program or library top level procs
// re bug 1898723 - Identination of procedures in library
diff --git a/components/jcf2/Settings/SetIndent.pas b/components/jcf2/Settings/SetIndent.pas
index c9b9d8ec42..d0bbfbe8a3 100644
--- a/components/jcf2/Settings/SetIndent.pas
+++ b/components/jcf2/Settings/SetIndent.pas
@@ -29,7 +29,7 @@ unit SetIndent;
interface
-uses JcfSetBase, SettingsStream;
+uses JcfSetBase, SettingsStream, SettingsTypes;
type
@@ -55,7 +55,7 @@ type
fbIndentNestedTypes: Boolean;
fbIndentVarAndConstInClass: Boolean;
fbIndentInterfaceGuid: boolean;
-
+ fbIndentLabels:TIndentLabels;
protected
public
constructor Create;
@@ -93,6 +93,7 @@ type
property IndentNestedTypes: Boolean read fbIndentNestedTypes write fbIndentNestedTypes;
property IndentVarAndConstInClass: Boolean read fbIndentVarAndConstInClass write fbIndentVarAndConstInClass;
+ property IndentLabels:TIndentLabels read fbIndentLabels write fbIndentLabels;
end;
implementation
@@ -120,6 +121,7 @@ const
REG_INDENT_VAR_AND_CONST_IN_CLASS = 'IndentVarAndConstInClass';
REG_INDENT_NESTED_TYPES = 'IndentNestedTypes';
REG_INDENT_INTERFACE_GUID = 'IndentInterfaceGuid';
+ REG_INDENT_LABELS = 'IndentLabels';
constructor TSetIndent.Create;
begin
@@ -158,7 +160,7 @@ begin
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);
-
+ fbIndentLabels := TIndentLabels(pcStream.Read(REG_INDENT_LABELS,Ord(eLabelIndentStatement)));
end;
procedure TSetIndent.WriteToStream(const pcOut: TSettingsOutput);
@@ -188,6 +190,7 @@ begin
pcOut.Write(REG_INDENT_NESTED_TYPES, fbIndentNestedTypes);
pcOut.Write(REG_INDENT_VAR_AND_CONST_IN_CLASS, fbIndentVarAndConstInClass);
pcOut.Write(REG_INDENT_INTERFACE_GUID, fbIndentInterfaceGuid);
+ pcOut.Write(REG_INDENT_LABELS, Ord(fbIndentLabels));
end;
function TSetIndent.SpacesForIndentLevel(const piLevel: integer): integer;
diff --git a/components/jcf2/Settings/SettingsTypes.pas b/components/jcf2/Settings/SettingsTypes.pas
index 9d159658dc..922bfdd3fc 100644
--- a/components/jcf2/Settings/SettingsTypes.pas
+++ b/components/jcf2/Settings/SettingsTypes.pas
@@ -55,9 +55,10 @@ type
3) turn to CrLf
4) pick 2 or 3 depending on the Host OS, preference, ie CrLf for win, Cr for 'nix
}
-type
TReturnChars = (rcLeaveAsIs, rcLinefeed, rcCrLf, rcPlatform);
+ TIndentLabels = (eLabelIndentStatement,eLabelIndentDontIndent,eLabelIndentPrevLevel,
+ eLabelIndentToProcedure,eLabelIndentX0);
implementation
diff --git a/components/jcf2/TestApplication/JCFSettings.cfg b/components/jcf2/TestApplication/JCFSettings.cfg
index e2277e10da..7b0b32c426 100644
--- a/components/jcf2/TestApplication/JCFSettings.cfg
+++ b/components/jcf2/TestApplication/JCFSettings.cfg
@@ -37,6 +37,7 @@
True
True
True
+ 0
True
diff --git a/components/jcf2/Ui/Settings/frClarifyIndent.lfm b/components/jcf2/Ui/Settings/frClarifyIndent.lfm
index cfcf695a55..a320a3630b 100644
--- a/components/jcf2/Ui/Settings/frClarifyIndent.lfm
+++ b/components/jcf2/Ui/Settings/frClarifyIndent.lfm
@@ -1,9 +1,9 @@
object fClarifyIndent: TfClarifyIndent
Left = 0
- Height = 426
+ Height = 458
Top = 0
Width = 430
- ClientHeight = 426
+ ClientHeight = 458
ClientWidth = 430
TabOrder = 0
DesignLeft = 737
@@ -41,13 +41,13 @@ object fClarifyIndent: TfClarifyIndent
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
- Height = 385
+ Height = 417
Top = 35
Width = 418
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Options'
- ClientHeight = 365
+ ClientHeight = 397
ClientWidth = 414
TabOrder = 1
object cbIndentBeginEnd: TCheckBox
@@ -287,5 +287,32 @@ object fClarifyIndent: TfClarifyIndent
Caption = 'Extra Indent for interface guid'
TabOrder = 15
end
+ object lbIndentLabels: TLabel
+ AnchorSideLeft.Control = gbOptions
+ AnchorSideTop.Control = cbIndentInterfaceGuid
+ AnchorSideTop.Side = asrBottom
+ Left = 6
+ Height = 15
+ Top = 368
+ Width = 67
+ BorderSpacing.Left = 6
+ BorderSpacing.Top = 12
+ Caption = 'Indent labels'
+ end
+ object cbIndentLabels: TComboBox
+ AnchorSideLeft.Control = lbIndentLabels
+ AnchorSideLeft.Side = asrBottom
+ AnchorSideTop.Control = lbIndentLabels
+ AnchorSideTop.Side = asrCenter
+ Left = 79
+ Height = 23
+ Top = 364
+ Width = 257
+ BorderSpacing.Left = 6
+ BorderSpacing.Top = 6
+ ItemHeight = 15
+ Style = csDropDownList
+ TabOrder = 16
+ end
end
end
diff --git a/components/jcf2/Ui/Settings/frClarifyIndent.pas b/components/jcf2/Ui/Settings/frClarifyIndent.pas
index a16885d3ec..d50dcd595b 100644
--- a/components/jcf2/Ui/Settings/frClarifyIndent.pas
+++ b/components/jcf2/Ui/Settings/frClarifyIndent.pas
@@ -40,6 +40,7 @@ type
TfClarifyIndent = class(TAbstractIDEOptionsEditor)
cbIndentCaseLabels: TCheckBox;
cbIndentInterfaceGuid: TCheckBox;
+ cbIndentLabels: TComboBox;
Label2: TLabel;
edtIndentSpaces: TSpinEdit;
gbOptions: TGroupBox;
@@ -57,6 +58,7 @@ type
cbIndentProcedureBody: TCheckBox;
cbIndentNestedTypes: TCheckBox;
cbIndentVarAndConstInClass: TCheckBox;
+ lbIndentLabels: TLabel;
procedure cbIndentBeginEndClick(Sender: TObject);
procedure cbHasFirstLevelIndentClick(Sender: TObject);
public
@@ -74,7 +76,7 @@ implementation
{$R *.lfm}
uses
- JcfSettings, JcfUIConsts, JcfIdeRegister;
+ JcfSettings, JcfUIConsts, JcfIdeRegister, SettingsTypes;
constructor TfClarifyIndent.Create(AOwner: TComponent);
begin
@@ -108,6 +110,13 @@ begin
cbIndentNestedTypes.Caption := lisIndentIndentNestedTypes;
cbIndentVarAndConstInClass.Caption := lisIndentIndentVarAndConstInClass;
cbIndentInterfaceGuid.Caption := lisIndentExtraIndentForInterfaceGuid;
+
+ cbIndentLabels.Items.Clear;
+ cbIndentLabels.Items.Add(lisIndentLabelsStatement);
+ cbIndentLabels.Items.Add(lisIndentLabelsDontIndent);
+ cbIndentLabels.Items.Add(lisIndentLabelsIndentPrevLevel);;
+ cbIndentLabels.Items.Add(lisIndentLabelslIndentToProcedure);
+ cbIndentLabels.Items.Add(lisIndentLabelsIndentX0);
end;
{-------------------------------------------------------------------------------
@@ -138,6 +147,7 @@ begin
cbIndentNestedTypes.Checked := IndentNestedTypes;
cbIndentVarAndConstInClass.Checked := IndentVarAndConstInClass;
cbIndentInterfaceGuid.Checked := IndentInterfaceGuid;
+ cbIndentLabels.ItemIndex := Ord(IndentLabels);
end;
cbIndentBeginEndClick(nil);
@@ -170,6 +180,7 @@ begin
IndentNestedTypes := cbIndentNestedTypes.Checked;
IndentVarAndConstInClass := cbIndentVarAndConstInClass.Checked;
IndentInterfaceGuid := cbIndentInterfaceGuid.Checked;
+ IndentLabels := TIndentLabels(cbIndentLabels.ItemIndex);
end;
end;