diff options
author | darmar <unknown> | 2017-04-18 09:32:34 +1000 |
---|---|---|
committer | darmar <unknown> | 2017-04-18 09:32:34 +1000 |
commit | 4d6694eccc5db0f9748cbda9152cec7b3c916169 (patch) | |
tree | 276c0c852e55a2e95b8fa280115816930f1201e1 /lexers/LexFortran.cxx | |
parent | 602902a69c52c8db02b376853800694868d6e65d (diff) | |
download | scintilla-mirror-4d6694eccc5db0f9748cbda9152cec7b3c916169.tar.gz |
Bug [#1935]. Recognize a preprocessor line after a line continuation.
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); |