aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-11-22 12:05:25 +0000
committernyamatongwe <devnull@localhost>2003-11-22 12:05:25 +0000
commitc55fcb668273198761636db06c14fabbc48f10af (patch)
tree03fc10c13cd6aa5cdaf6fb82f6f5063da4d22a6f
parentbcd8a0f46d6abf5f8f5bbb131efed32d62a00da1 (diff)
downloadscintilla-mirror-c55fcb668273198761636db06c14fabbc48f10af.tar.gz
Fix from Shen for folding bug.
-rw-r--r--src/LexFortran.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/LexFortran.cxx b/src/LexFortran.cxx
index 72de3193a..0cc7342e6 100644
--- a/src/LexFortran.cxx
+++ b/src/LexFortran.cxx
@@ -50,7 +50,7 @@ unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) {
}
/***************************************/
static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle,
- WordList *keywordlists[], Accessor &styler, bool isFixFormat) {
+ WordList *keywordlists[], Accessor &styler, bool isFixFormat) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
@@ -143,7 +143,7 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
}
sc.SetState(SCE_F_DEFAULT);
}
- } else if (sc.state == SCE_F_COMMENT) {
+ } else if (sc.state == SCE_F_COMMENT || sc.state == SCE_F_PREPROCESSOR) {
if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_F_DEFAULT);
}
@@ -193,7 +193,11 @@ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle
// Determine if a new state should be entered.
if (sc.state == SCE_F_DEFAULT) {
if (sc.ch == '!') {
- sc.SetState(SCE_F_COMMENT);
+ if (sc.chNext == '$') {
+ sc.SetState(SCE_F_PREPROCESSOR);
+ } else {
+ sc.SetState(SCE_F_COMMENT);
+ }
} else if ((!isFixFormat) && IsADigit(sc.ch) && numNonBlank == 1) {
sc.SetState(SCE_F_LABEL);
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
@@ -302,9 +306,7 @@ static void FoldFortranDoc(unsigned int startPos, int length, int initStyle,
s[k] = '\0';
// Handle the forall and where statement and structure.
if (strcmp(s, "forall") == 0 || strcmp(s, "where") == 0) {
- if (strcmp(prevWord, "end") == 0) {
- levelCurrent--;
- } else {
+ if (strcmp(prevWord, "end") != 0) {
j = i + 1;
char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j);
// Find the position of the first (