diff options
Diffstat (limited to 'lexers/LexFortran.cxx')
-rw-r--r-- | lexers/LexFortran.cxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lexers/LexFortran.cxx b/lexers/LexFortran.cxx index 37e0b45c5..641702893 100644 --- a/lexers/LexFortran.cxx +++ b/lexers/LexFortran.cxx @@ -120,14 +120,6 @@ static void ColouriseFortranDoc(Sci_PositionU startPos, Sci_Position length, int continue; } /***************************************/ - // Hanndle preprocessor directives - if (sc.ch == '#' && numNonBlank == 1) - { - sc.SetState(SCE_F_PREPROCESSOR); - while (!sc.atLineEnd && sc.More()) - sc.Forward(); // Until line end - } - /***************************************/ // Handle line continuation generically. if (!isFixFormat && sc.ch == '&' && sc.state != SCE_F_COMMENT) { char chTemp = ' '; @@ -143,7 +135,11 @@ static void ColouriseFortranDoc(Sci_PositionU startPos, Sci_Position length, int int currentState = sc.state; sc.SetState(SCE_F_CONTINUATION); sc.ForwardSetState(SCE_F_DEFAULT); - while (IsASpace(sc.ch) && sc.More()) sc.Forward(); + while (IsASpace(sc.ch) && sc.More()) { + sc.Forward(); + if (sc.atLineStart) numNonBlank = 0; + if (!IsASpaceOrTab(sc.ch)) numNonBlank ++; + } if (sc.ch == '&') { sc.SetState(SCE_F_CONTINUATION); sc.Forward(); @@ -152,6 +148,14 @@ static void ColouriseFortranDoc(Sci_PositionU startPos, Sci_Position length, int } } /***************************************/ + // Hanndle preprocessor directives + if (sc.ch == '#' && numNonBlank == 1) + { + sc.SetState(SCE_F_PREPROCESSOR); + while (!sc.atLineEnd && sc.More()) + sc.Forward(); // Until line end + } + /***************************************/ // Determine if the current state should terminate. if (sc.state == SCE_F_OPERATOR) { sc.SetState(SCE_F_DEFAULT); |