From 1db5f4272e8352fc6fcf8c26d1984adf2b3bb733 Mon Sep 17 00:00:00 2001 From: DomingoGP Date: Mon, 28 Oct 2024 10:44:55 +0100 Subject: [PATCH] Jedi code format: add support for "Whitesmiths" format style. --- .../jcf2/CommandLine/Lazarus/jcfsettings.cfg | 4 + .../jcf2/IdePlugin/lazarus/jcfuiconsts.pas | 3 + .../lazarus/languages/jcfuiconsts.cs.po | 13 ++ .../lazarus/languages/jcfuiconsts.de.po | 13 ++ .../lazarus/languages/jcfuiconsts.es.po | 13 ++ .../lazarus/languages/jcfuiconsts.fr.po | 13 ++ .../lazarus/languages/jcfuiconsts.hu.po | 13 ++ .../lazarus/languages/jcfuiconsts.it.po | 13 ++ .../lazarus/languages/jcfuiconsts.ja.po | 13 ++ .../lazarus/languages/jcfuiconsts.lt.po | 13 ++ .../lazarus/languages/jcfuiconsts.pl.po | 13 ++ .../lazarus/languages/jcfuiconsts.pot | 13 ++ .../lazarus/languages/jcfuiconsts.pt_BR.po | 13 ++ .../lazarus/languages/jcfuiconsts.ru.po | 13 ++ .../lazarus/languages/jcfuiconsts.uk.po | 13 ++ .../lazarus/languages/jcfuiconsts.zh_CN.po | 13 ++ components/jcf2/Process/Indent/Indenter.pas | 66 ++++++++- components/jcf2/Settings/SetIndent.pas | 29 ++++ .../jcf2/TestApplication/JCFSettings.cfg | 4 + .../jcf2/Ui/Settings/frClarifyIndent.lfm | 132 +++++++++++++----- .../jcf2/Ui/Settings/frClarifyIndent.pas | 26 ++++ 21 files changed, 405 insertions(+), 41 deletions(-) diff --git a/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg b/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg index 07840542a6..24e45c736f 100644 --- a/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg +++ b/components/jcf2/CommandLine/Lazarus/jcfsettings.cfg @@ -24,7 +24,9 @@ 0 False False + False 2 + 2 True False True @@ -38,6 +40,8 @@ False True 0 + False + False True diff --git a/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas b/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas index db45f65e99..ad7b2ffa06 100644 --- a/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas +++ b/components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas @@ -119,6 +119,9 @@ resourcestring lisIndentLabelsIndentPrevLevel = 'Indent to prior level'; lisIndentLabelslIndentToProcedure = 'Indent to procedure level'; lisIndentLabelsIndentX0 = 'Indent to first column position'; + lisIndentTryFinallyExcept = 'Indent try/finally/except'; + lisIndentEndTryBlockAsCode = 'Indent end try block as code'; + lisIndentExtraOrphanTryBlocks = 'Extra Indent for orphan try blocks'; //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 1c24df3984..7cb50d042c 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po @@ -640,6 +640,11 @@ msgstr "" msgid "Different indent for first level" msgstr "" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "" @@ -660,6 +665,10 @@ msgstr "" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "" @@ -724,6 +733,10 @@ msgstr "" msgid "Options" msgstr "" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po index 777c22c090..aba3d4cbb5 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po @@ -641,6 +641,11 @@ msgstr "Leerzeichen für Blockeinrücking" msgid "Different indent for first level" msgstr "Unterschiedliche Einrückung in der ersten Ebene" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Zusätzliche Einrückung für Begin/End in Prozeduren" @@ -661,6 +666,10 @@ msgstr "Zusätzliche Einrückung bei If..Else-Blöcken" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Einrückung" @@ -728,6 +737,10 @@ msgstr "" msgid "Options" msgstr "Einstellungen" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "JCF-Formateinstellungen" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po index 7b24c0c02f..61e525c716 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po @@ -636,6 +636,11 @@ msgstr "" msgid "Different indent for first level" msgstr "" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "" @@ -656,6 +661,10 @@ msgstr "" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "" @@ -720,6 +729,10 @@ msgstr "" msgid "Options" msgstr "" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po index 0010d225c8..7daa1a97e9 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po @@ -642,6 +642,11 @@ msgstr "Espaces de retrait de bloc" msgid "Different indent for first level" msgstr "Retrait différent pour le premier niveau" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Retrait supplémentaire pour \"begin/end\" dans les procédures" @@ -662,6 +667,10 @@ msgstr "Retrait supplémentaire pour les blocs \"If...Else\"" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Indentation" @@ -728,6 +737,10 @@ msgstr "" msgid "Options" msgstr "Options" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "Paramètres de formatage de JCF" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po index 99a42a4ac9..6e36244a9f 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po @@ -643,6 +643,11 @@ msgstr "Blokkbehúzás szóközeinek száma" msgid "Different indent for first level" msgstr "Eltérő behúzás az első szinten" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Extra behúzás a begin/end számára eljárásokban" @@ -663,6 +668,10 @@ msgstr "Extra behúzás az If...Else számára" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Behúzás" @@ -729,6 +738,10 @@ msgstr "" msgid "Options" msgstr "Beállítások" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "JCF formázás beállításai" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po index 1a686ba416..6cc97f97d3 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po @@ -643,6 +643,11 @@ msgstr "Spazi di indentazione dei blocchi" msgid "Different indent for first level" msgstr "Indentazione diversa per il primo livello" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Indentazione extra per begin/end all'interno delle procedure" @@ -663,6 +668,10 @@ msgstr "Indentazione extra per blocchi If...Else" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Indentazione" @@ -729,6 +738,10 @@ msgstr "" msgid "Options" msgstr "Opzioni" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "Impostazioni formato JCF" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po index 99b2883cdc..4de96b4569 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po @@ -642,6 +642,11 @@ msgstr "ブロックインデントの空白数" msgid "Different indent for first level" msgstr "最初のレベルとは異なるインデント" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "手続き内での begin/end にインデントを追加する" @@ -662,6 +667,10 @@ msgstr "if...else ブロックにインデントを追加する" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "インデント" @@ -728,6 +737,10 @@ msgstr "" msgid "Options" msgstr "オプション" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "JCF 整形設定" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po index e8c94e2dcb..73de9ba43c 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po @@ -642,6 +642,11 @@ msgstr "Tarpai bloko įtraukoje" msgid "Different indent for first level" msgstr "Pirmam lygiui kitokia įtrauka" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Papildoma „begin“/„end“ įtrauka procedūrų viduje" @@ -662,6 +667,10 @@ msgstr "Papildoma „If...Else“ blokų įtrauką" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Įtrauka" @@ -728,6 +737,10 @@ msgstr "" msgid "Options" msgstr "Parinktys" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "JCF formato nuostatos" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po index 2509ecc783..1860a6e08b 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po @@ -642,6 +642,11 @@ msgstr "" msgid "Different indent for first level" msgstr "" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "" @@ -662,6 +667,10 @@ msgstr "" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "" @@ -726,6 +735,10 @@ msgstr "" msgid "Options" msgstr "Opcje" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot index 43171ff740..5373a175d2 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot @@ -620,6 +620,11 @@ msgstr "" msgid "Different indent for first level" msgstr "" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "" @@ -640,6 +645,10 @@ msgstr "" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "" @@ -704,6 +713,10 @@ msgstr "" msgid "Options" msgstr "" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po index 7ba8bfba45..925de22620 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po @@ -642,6 +642,11 @@ msgstr "Espaços identação blocos" msgid "Different indent for first level" msgstr "Identação diferente para primeiro nível" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Identação extra para \"begin/end\" dentro de procedimento" @@ -662,6 +667,10 @@ msgstr "Identação extra para blocos \"If...Else\"" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Identação" @@ -728,6 +737,10 @@ msgstr "" msgid "Options" msgstr "Opções" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "Configurações \"JCF\"" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po index e4b101e821..ec23d40bc8 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po @@ -634,6 +634,11 @@ msgstr "Отступ блока в пробелах" msgid "Different indent for first level" msgstr "Другой отступ для блоков первого уровня" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Дополнительный отступ для begin/end в процедурах" @@ -654,6 +659,10 @@ msgstr "Дополнительный отступ для блоков If...Else" msgid "Extra Indent for interface GUID" msgstr "Дополнительный отступ для GUID интерфейса" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Отступы" @@ -718,6 +727,10 @@ msgstr "Добавить для оператора" msgid "Options" msgstr "Параметры" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "Форматирование кода JEDI" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po index eb4aa10f97..46729fb767 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po @@ -645,6 +645,11 @@ msgstr "Пробіли відступу в блоках" msgid "Different indent for first level" msgstr "Інший відступ для першого рівня" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "Додатковий відступ для begin/end в процедурах" @@ -665,6 +670,10 @@ msgstr "Додатковий відступ для блоків If...Else" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "Відступи" @@ -729,6 +738,10 @@ msgstr "" msgid "Options" msgstr "Параметри" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "Параметри форматування JCF" diff --git a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po index 81d7f23e2b..252ee0454c 100644 --- a/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po +++ b/components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po @@ -642,6 +642,11 @@ msgstr "语句块缩进空格" msgid "Different indent for first level" msgstr "" +#: jcfuiconsts.lisindentendtryblockascode +msgctxt "jcfuiconsts.lisindentendtryblockascode" +msgid "Indent end try block as code" +msgstr "" + #: jcfuiconsts.lisindentextraindentforbeginend msgid "Extra indent for begin/end inside procedures" msgstr "" @@ -662,6 +667,10 @@ msgstr "" msgid "Extra Indent for interface GUID" msgstr "" +#: jcfuiconsts.lisindentextraorphantryblocks +msgid "Extra Indent for orphan try blocks" +msgstr "" + #: jcfuiconsts.lisindentindentation msgid "Indentation" msgstr "缩进(Indentation)" @@ -726,6 +735,10 @@ msgstr "" msgid "Options" msgstr "选项" +#: jcfuiconsts.lisindenttryfinallyexcept +msgid "Indent try/finally/except" +msgstr "" + #: jcfuiconsts.lisjcfformatsettings msgid "JCF Format Settings" msgstr "JCF格式设置" diff --git a/components/jcf2/Process/Indent/Indenter.pas b/components/jcf2/Process/Indent/Indenter.pas index ff428af012..f37736db29 100644 --- a/components/jcf2/Process/Indent/Indenter.pas +++ b/components/jcf2/Process/Indent/Indenter.pas @@ -338,6 +338,32 @@ begin end; end; +function IsEndOfFinallyOrExceptBlock(const pt:TSourceToken):boolean; +begin + result := (pt.TokenType = ttEnd) and (pt.HasParentNode(nFinallyBlock,1) or pt.HasParentNode(nExceptBlock)); +end; + +function OrphanTryBlocksCount(const pt: TSourceToken): integer; +var + lcParent: TParseTreeNode; +begin + Result := 0; + lcParent := pt; + while (lcParent <> nil) do + begin + if lcParent.NodeType = nTryAndHandlerBlock then + begin + lcParent := lcParent.Parent; + if (lcParent <> nil) and (lcParent.NodeType = nStatement) then + lcParent := lcParent.Parent; + if (lcParent <> nil) and (lcParent.NodeType <> nStatementList) then + Inc(Result); + end; + if lcParent <> nil then + lcParent := lcParent.Parent; + end; +end; + function CalculateIndent(const pt: TSourceToken;aAlignPreprocessor:boolean=true): integer;forward; //Align {$ENDIF}/{$IFEND}/{$ELSE}/{$ELSEIF} with his {$IF}/{$IFDEF}/{$$IFNDEF}/{$IFOPT} @@ -648,8 +674,21 @@ begin if FormattingSettings.Indent.IndentElse then liIndentCount := liIndentCount + ElseDepth(pt); - + //increment indent for orphan try blocks + // if condition then while condition do ... + // try + // finally + // end + if FormattingSettings.Indent.IndentExtraOrphanTryBlocks then + begin + if pt.HasParentNode(nTryAndHandlerBlock) then + begin + liIndentCount := liIndentCount + OrphanTryBlocksCount(pt); + end; + end; + if (pt.TokenType=ttEnd) and FormattingSettings.Indent.IndentEndTryBlockAsCode and IsEndOfFinallyOrExceptBlock(pt) then + inc(liIndentCount); end; // procedures { record declaration stuph } @@ -794,12 +833,29 @@ begin // IndentBeginEnd option to indent begin/end words a bit extra if FormattingSettings.Indent.IndentBeginEnd then begin - if (pt.TokenType in [ttTry, ttExcept, ttFinally, ttBegin, ttEnd]) and InStatements(pt) then + if (pt.TokenType in [ttBegin, ttEnd]) and InStatements(pt) then begin - // filter out the begin/end that starts and ends a procedure - if not pt.HasParentNode(nBlock, 2) then + if not IsEndOfFinallyOrExceptBlock(pt) then begin - Result := Result + FormattingSettings.Indent.IndentBeginEndSpaces; + // filter out the begin/end that starts and ends a procedure + if not pt.HasParentNode(nBlock, 2) then + begin + Result := Result + FormattingSettings.Indent.IndentBeginEndSpaces; + end; + end; + end; + end; + if FormattingSettings.Indent.IndentExtraTryBlockKeyWords then + begin + if ((pt.TokenType in [ttTry, ttExcept, ttFinally]) or IsEndOfFinallyOrExceptBlock(pt)) and InStatements(pt) then + begin + if not ((pt.TokenType=ttEnd) and FormattingSettings.Indent.IndentEndTryBlockAsCode) then + begin + // filter out the begin/end that starts and ends a procedure + if not pt.HasParentNode(nBlock, 2) then + begin + Result := Result + FormattingSettings.Indent.IndentExtraTryBlockKeyWordsSpaces; + end; end; end; end; diff --git a/components/jcf2/Settings/SetIndent.pas b/components/jcf2/Settings/SetIndent.pas index d0bbfbe8a3..9c662d0efb 100644 --- a/components/jcf2/Settings/SetIndent.pas +++ b/components/jcf2/Settings/SetIndent.pas @@ -56,6 +56,10 @@ type fbIndentVarAndConstInClass: Boolean; fbIndentInterfaceGuid: boolean; fbIndentLabels:TIndentLabels; + fbIndentExtraTryBlockKeyWords:boolean; + fiIndentExtraTryBlockKeyWordsSpaces:integer; + fbIndentEndTryBlockAsCode:boolean; + fbIndentExtraOrphanTryBlocks:boolean; protected public constructor Create; @@ -94,6 +98,10 @@ type property IndentNestedTypes: Boolean read fbIndentNestedTypes write fbIndentNestedTypes; property IndentVarAndConstInClass: Boolean read fbIndentVarAndConstInClass write fbIndentVarAndConstInClass; property IndentLabels:TIndentLabels read fbIndentLabels write fbIndentLabels; + property IndentExtraTryBlockKeyWords:boolean read fbIndentExtraTryBlockKeyWords write fbIndentExtraTryBlockKeyWords; + property IndentExtraTryBlockKeyWordsSpaces:integer read fiIndentExtraTryBlockKeyWordsSpaces write fiIndentExtraTryBlockKeyWordsSpaces; + property IndentEndTryBlockAsCode:boolean read fbIndentEndTryBlockAsCode write fbIndentEndTryBlockAsCode; + property IndentExtraOrphanTryBlocks:boolean read fbIndentExtraOrphanTryBlocks write fbIndentExtraOrphanTryBlocks; end; implementation @@ -122,6 +130,10 @@ const REG_INDENT_NESTED_TYPES = 'IndentNestedTypes'; REG_INDENT_INTERFACE_GUID = 'IndentInterfaceGuid'; REG_INDENT_LABELS = 'IndentLabels'; + REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS = 'IndentExtraTryBlockKeyWords'; + REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS_SPACES = 'IndentExtraTryBlockKeyWordsSpaces'; + REG_INDENT_END_TRY_BLOCK_AS_CODE = 'IndentEndTryBlockAsCode'; + REG_INDENT_EXTRA_ORPHAN_TRY_BLOCKS = 'IndentExtraOrphanTryBlocks'; constructor TSetIndent.Create; begin @@ -141,6 +153,17 @@ begin fbIndentBeginEnd := pcStream.Read(REG_INDENT_BEGIN_END, False); fiIndentBeginEndSpaces := pcStream.Read(REG_INDENT_BEGIN_END_SPACES, 1); + if pcStream.HasTag(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS) then + begin + fbIndentExtraTryBlockKeyWords := pcStream.Read(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS, False); + fiIndentExtraTryBlockKeyWordsSpaces :=pcStream.Read(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS_SPACES, 1); + end + else + begin + fbIndentExtraTryBlockKeyWords := pcStream.Read(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS, fbIndentBeginEnd); + fiIndentExtraTryBlockKeyWordsSpaces := pcStream.Read(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS_SPACES, fiIndentBeginEndSpaces); + end; + fbIndentLibraryProcs := pcStream.Read(REG_INDENT_LIBRARY_PROCS, True); fbIndentProcedureBody := pcStream.Read(REG_INDENT_PROCEDURE_BODY, False); @@ -161,6 +184,8 @@ begin 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))); + fbIndentEndTryBlockAsCode := pcStream.Read(REG_INDENT_END_TRY_BLOCK_AS_CODE, False); + fbIndentExtraOrphanTryBlocks := pcStream.Read(REG_INDENT_EXTRA_ORPHAN_TRY_BLOCKS, False); end; procedure TSetIndent.WriteToStream(const pcOut: TSettingsOutput); @@ -173,7 +198,9 @@ begin pcOut.Write(REG_HAS_FIRST_LEVEL_INDENT, fbHasFirstLevelIndent); pcOut.Write(REG_INDENT_BEGIN_END, fbIndentBeginEnd); + pcOut.Write(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS, fbIndentExtraTryBlockKeyWords); pcOut.Write(REG_INDENT_BEGIN_END_SPACES, fiIndentBeginEndSpaces); + pcOut.Write(REG_INDENT_EXTRA_TRY_BLOCK_KEYWORDS_SPACES, fiIndentExtraTryBlockKeyWordsSpaces); pcOut.Write(REG_INDENT_LIBRARY_PROCS, fbIndentLibraryProcs); pcOut.Write(REG_INDENT_PROCEDURE_BODY, fbIndentProcedureBody); @@ -191,6 +218,8 @@ begin pcOut.Write(REG_INDENT_VAR_AND_CONST_IN_CLASS, fbIndentVarAndConstInClass); pcOut.Write(REG_INDENT_INTERFACE_GUID, fbIndentInterfaceGuid); pcOut.Write(REG_INDENT_LABELS, Ord(fbIndentLabels)); + pcOut.Write(REG_INDENT_END_TRY_BLOCK_AS_CODE, fbIndentEndTryBlockAsCode); + pcOut.Write(REG_INDENT_EXTRA_ORPHAN_TRY_BLOCKS, fbIndentExtraOrphanTryBlocks); end; function TSetIndent.SpacesForIndentLevel(const piLevel: integer): integer; diff --git a/components/jcf2/TestApplication/JCFSettings.cfg b/components/jcf2/TestApplication/JCFSettings.cfg index 7b0b32c426..1fa0988237 100644 --- a/components/jcf2/TestApplication/JCFSettings.cfg +++ b/components/jcf2/TestApplication/JCFSettings.cfg @@ -24,7 +24,9 @@ 0 False False + False 2 + 2 True False True @@ -38,6 +40,8 @@ True True 0 + False + False True diff --git a/components/jcf2/Ui/Settings/frClarifyIndent.lfm b/components/jcf2/Ui/Settings/frClarifyIndent.lfm index a320a3630b..caa59367a6 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 = 458 + Height = 539 Top = 0 Width = 430 - ClientHeight = 458 + ClientHeight = 539 ClientWidth = 430 TabOrder = 0 DesignLeft = 737 @@ -41,13 +41,13 @@ object fClarifyIndent: TfClarifyIndent AnchorSideBottom.Control = Owner AnchorSideBottom.Side = asrBottom Left = 6 - Height = 417 + Height = 498 Top = 35 Width = 418 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Around = 6 Caption = 'Options' - ClientHeight = 397 + ClientHeight = 478 ClientWidth = 414 TabOrder = 1 object cbIndentBeginEnd: TCheckBox @@ -85,27 +85,27 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrCenter Left = 6 Height = 19 - Top = 37 + Top = 66 Width = 169 BorderSpacing.Left = 6 BorderSpacing.Bottom = 6 Caption = 'Different indent for first level' - TabOrder = 2 + TabOrder = 4 OnClick = cbHasFirstLevelIndentClick end object eFirstLevelIndent: TSpinEdit - AnchorSideTop.Control = eIndentBeginEndSpaces + AnchorSideTop.Control = eIndentTryFinallyExceptSpaces AnchorSideTop.Side = asrBottom AnchorSideRight.Control = gbOptions AnchorSideRight.Side = asrBottom Left = 344 Height = 23 - Top = 35 + Top = 64 Width = 50 Anchors = [akTop, akRight] BorderSpacing.Top = 6 BorderSpacing.Right = 20 - TabOrder = 3 + TabOrder = 5 end object cbKeepWithInProc: TCheckBox AnchorSideLeft.Control = gbOptions @@ -113,14 +113,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 62 + Top = 91 Width = 292 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Keep single-line comments with code in procedures' - TabOrder = 4 + TabOrder = 6 end object cbKeepWithInGlobals: TCheckBox AnchorSideLeft.Control = gbOptions @@ -128,14 +128,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 87 + Top = 116 Width = 271 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Keep single-line comments with code in globals' - TabOrder = 5 + TabOrder = 7 end object cbKeepWithInClassDef: TCheckBox AnchorSideLeft.Control = gbOptions @@ -143,14 +143,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 112 + Top = 141 Width = 317 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Keep single-line comments with code in class definitions' - TabOrder = 6 + TabOrder = 8 end object cbKeepWithElsewhere: TCheckBox AnchorSideLeft.Control = gbOptions @@ -158,14 +158,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 137 + Top = 166 Width = 272 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Keep single-line comments with code elsewhere' - TabOrder = 7 + TabOrder = 9 end object cbIndentIfElse: TCheckBox AnchorSideLeft.Control = gbOptions @@ -173,14 +173,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 162 + Top = 191 Width = 174 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Extra Indent for If...Else blocks' - TabOrder = 8 + TabOrder = 10 end object cbIndentCaseElse: TCheckBox AnchorSideLeft.Control = gbOptions @@ -188,14 +188,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 212 + Top = 241 Width = 192 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Extra Indent for Case...Else blocks' - TabOrder = 10 + TabOrder = 12 end object cbIndentLibraryProcs: TCheckBox AnchorSideLeft.Control = gbOptions @@ -203,14 +203,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 237 + Top = 266 Width = 181 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Indent for procedures in library' - TabOrder = 11 + TabOrder = 13 end object cbIndentProcedureBody: TCheckBox AnchorSideLeft.Control = gbOptions @@ -218,14 +218,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 262 + Top = 291 Width = 157 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Indent for procedure body' - TabOrder = 12 + TabOrder = 14 end object cbIndentNestedTypes: TCheckBox AnchorSideLeft.Control = gbOptions @@ -233,14 +233,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 287 + Top = 316 Width = 121 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Indent nested types' - TabOrder = 13 + TabOrder = 15 end object cbIndentVarAndConstInClass: TCheckBox AnchorSideLeft.Control = gbOptions @@ -248,14 +248,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 312 + Top = 341 Width = 167 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Indent var and const in class' - TabOrder = 14 + TabOrder = 16 end object cbIndentCaseLabels: TCheckBox AnchorSideLeft.Control = gbOptions @@ -263,14 +263,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 187 + Top = 216 Width = 157 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Extra Indent for case labels' - TabOrder = 9 + TabOrder = 11 end object cbIndentInterfaceGuid: TCheckBox AnchorSideLeft.Control = gbOptions @@ -278,14 +278,14 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 19 - Top = 337 + Top = 366 Width = 174 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 Caption = 'Extra Indent for interface guid' - TabOrder = 15 + TabOrder = 17 end object lbIndentLabels: TLabel AnchorSideLeft.Control = gbOptions @@ -293,7 +293,7 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrBottom Left = 6 Height = 15 - Top = 368 + Top = 397 Width = 67 BorderSpacing.Left = 6 BorderSpacing.Top = 12 @@ -306,13 +306,73 @@ object fClarifyIndent: TfClarifyIndent AnchorSideTop.Side = asrCenter Left = 79 Height = 23 - Top = 364 + Top = 393 Width = 257 BorderSpacing.Left = 6 BorderSpacing.Top = 6 ItemHeight = 15 Style = csDropDownList - TabOrder = 16 + TabOrder = 18 + end + object eIndentTryFinallyExceptSpaces: TSpinEdit + AnchorSideTop.Control = eIndentBeginEndSpaces + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = gbOptions + AnchorSideRight.Side = asrBottom + Left = 344 + Height = 23 + Top = 35 + Width = 50 + Anchors = [akTop, akRight] + BorderSpacing.Top = 6 + BorderSpacing.Right = 20 + MaxValue = 10 + MinValue = -10 + TabOrder = 3 + end + object cbIndentExtraTryBlockKeywords: TCheckBox + AnchorSideLeft.Control = gbOptions + AnchorSideTop.Control = eIndentTryFinallyExceptSpaces + AnchorSideTop.Side = asrCenter + Left = 6 + Height = 19 + Top = 37 + Width = 191 + BorderSpacing.Left = 6 + BorderSpacing.Bottom = 6 + Caption = 'Extra indent for try/finally/except' + TabOrder = 2 + OnClick = cbIndentExtraTryBlockKeywordsClick + end + object cbIndentEndTryBlockAsCode: TCheckBox + AnchorSideLeft.Control = gbOptions + AnchorSideTop.Control = cbIndentLabels + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 19 + Top = 422 + Width = 167 + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + BorderSpacing.Bottom = 6 + Caption = 'Indent end try block as code' + TabOrder = 19 + end + object cbIndentExtraOrphanTryBlocks: TCheckBox + AnchorSideLeft.Control = gbOptions + AnchorSideTop.Control = cbIndentEndTryBlockAsCode + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 19 + Top = 447 + Width = 193 + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + BorderSpacing.Bottom = 6 + Caption = 'Extra indent for orphan try blocks' + TabOrder = 20 end end end diff --git a/components/jcf2/Ui/Settings/frClarifyIndent.pas b/components/jcf2/Ui/Settings/frClarifyIndent.pas index a4cb9fbbc8..95dcdecbaf 100644 --- a/components/jcf2/Ui/Settings/frClarifyIndent.pas +++ b/components/jcf2/Ui/Settings/frClarifyIndent.pas @@ -38,9 +38,13 @@ type { TfClarifyIndent } TfClarifyIndent = class(TAbstractIDEOptionsEditor) + cbIndentEndTryBlockAsCode: TCheckBox; + cbIndentExtraOrphanTryBlocks: TCheckBox; + cbIndentExtraTryBlockKeywords: TCheckBox; cbIndentCaseLabels: TCheckBox; cbIndentInterfaceGuid: TCheckBox; cbIndentLabels: TComboBox; + eIndentTryFinallyExceptSpaces: TSpinEdit; Label2: TLabel; edtIndentSpaces: TSpinEdit; gbOptions: TGroupBox; @@ -61,6 +65,7 @@ type lbIndentLabels: TLabel; procedure cbIndentBeginEndClick(Sender: TObject); procedure cbHasFirstLevelIndentClick(Sender: TObject); + procedure cbIndentExtraTryBlockKeywordsClick(Sender: TObject); public constructor Create(AOwner: TComponent); override; @@ -119,6 +124,10 @@ begin cbIndentLabels.Items.Add(lisIndentLabelsIndentPrevLevel);; cbIndentLabels.Items.Add(lisIndentLabelslIndentToProcedure); cbIndentLabels.Items.Add(lisIndentLabelsIndentX0); + + cbIndentExtraTryBlockKeywords.Caption := lisIndentTryFinallyExcept; + cbIndentEndTryBlockAsCode.Caption := lisIndentEndTryBlockAsCode; + cbIndentExtraOrphanTryBlocks.Caption := lisIndentExtraOrphanTryBlocks; end; {------------------------------------------------------------------------------- @@ -150,6 +159,12 @@ begin cbIndentVarAndConstInClass.Checked := IndentVarAndConstInClass; cbIndentInterfaceGuid.Checked := IndentInterfaceGuid; cbIndentLabels.ItemIndex := Ord(IndentLabels); + + cbIndentExtraTryBlockKeywords.Checked := IndentExtraTryBlockKeyWords; + eIndentTryFinallyExceptSpaces.Value := IndentExtraTryBlockKeyWordsSpaces; + eIndentTryFinallyExceptSpaces.Enabled := IndentExtraTryBlockKeyWords; + cbIndentEndTryBlockAsCode.Checked := IndentEndTryBlockAsCode; + cbIndentExtraOrphanTryBlocks.Checked := IndentExtraOrphanTryBlocks; end; cbIndentBeginEndClick(nil); @@ -183,6 +198,12 @@ begin IndentVarAndConstInClass := cbIndentVarAndConstInClass.Checked; IndentInterfaceGuid := cbIndentInterfaceGuid.Checked; IndentLabels := TIndentLabels(cbIndentLabels.ItemIndex); + + IndentExtraTryBlockKeyWords := cbIndentExtraTryBlockKeywords.Checked; + IndentExtraTryBlockKeyWordsSpaces := eIndentTryFinallyExceptSpaces.Value; + IndentEndTryBlockAsCode := cbIndentEndTryBlockAsCode.Checked; + IndentExtraOrphanTryBlocks := cbIndentExtraOrphanTryBlocks.Checked; + end; end; @@ -204,6 +225,11 @@ begin eFirstLevelIndent.Enabled := cbHasFirstLevelIndent.Checked; end; +procedure TfClarifyIndent.cbIndentExtraTryBlockKeywordsClick(Sender: TObject); +begin + eIndentTryFinallyExceptSpaces.Enabled := cbIndentExtraTryBlockKeywords.Checked; +end; + initialization RegisterIDEOptionsEditor(JCFOptionsGroup, TfClarifyIndent, JCFOptionIndentation, JCFOptionClarify); end.