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* !.*$
- -->
-
+
+
+
+
+