From 5ff261aa0f6ad2afaf91910ed4b120367f9c587a Mon Sep 17 00:00:00 2001 From: Tomas Matheson <315234@googlemail.com> Date: Wed, 9 Mar 2016 09:59:02 +0000 Subject: [PATCH] improved indentation rules --- ...tation Rules (FortranModern).tmPreferences | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/settings/Indentation Rules (FortranModern).tmPreferences b/settings/Indentation Rules (FortranModern).tmPreferences index e18e40f..11f4c88 100644 --- a/settings/Indentation Rules (FortranModern).tmPreferences +++ b/settings/Indentation Rules (FortranModern).tmPreferences @@ -6,27 +6,44 @@ scopesource.modern-fortran settings + increaseIndentPattern (?xi) ^ [^!]* \bthen\b \s* (!.*)? $ - | ^ \s* (program|subroutine|function|module|do|where) \b .* $ - | ^ \s* (else\s*if|elsewhere) \b .* $ + | ^ \s* \w+: \s* \b do \b .* $ + | ^ \s* (program|subroutine|function|module|do) \b .* $ + | ^ \s* (where|forall) \s* (?<re> \((?: (?> [^()]+ ) | \g<re> )* \) ) \s* $ + | ^ \s* (else|else\s*if|elsewhere) \b .* $ + | ^ \s* (select\s+case|case) \b .* $ decreaseIndentPattern (?xi) ^ \s* (end) \b \s* $ - | ^ \s* end\s*(program|subroutine|function|module|do|if|where|forall) \b \s* $ + | ^ \s* end \s* (program|subroutine|function|module|do|if|where|forall|select) \b .* $ | ^ \s* (else|else\s*if|else\s*where) \b + | ^ \s* (case) \b .* $ - + + unIndentedLinePattern + (?xi) + ^\s* \#\w+ .* $ + | ^\s* !.{71}$ + | ^\s* !.*$ - --> - + + + + +