diff options
author | nyamatongwe <unknown> | 2002-11-15 23:50:27 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-11-15 23:50:27 +0000 |
commit | 562fe1ca25bbcaa8f7aab46ca4a3b080969cbb9f (patch) | |
tree | dfb202e3c6f9939b0a607927de7b0cd009d78be8 /src | |
parent | acc2ca9bc97b5469b53df8ffa7db1519b43d3072 (diff) | |
download | scintilla-mirror-562fe1ca25bbcaa8f7aab46ca4a3b080969cbb9f.tar.gz |
Fix to lines in make files that start with "=".
Diffstat (limited to 'src')
-rw-r--r-- | src/LexOthers.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index 60f91ba5f..4e68ca457 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -264,7 +264,7 @@ static void ColouriseMakeLine( Accessor &styler) { unsigned int i = 0; - unsigned int lastNonSpace = 0; + int lastNonSpace = -1; unsigned int state = SCE_MAKE_DEFAULT; bool bSpecial = false; // Skip initial spaces @@ -291,13 +291,15 @@ static void ColouriseMakeLine( if (lineBuffer[i] == ':') { // We should check that no colouring was made since the beginning of the line, // to avoid colouring stuff like /OUT:file - styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET); + if (lastNonSpace >= 0) + styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET); styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT); styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR); bSpecial = true; // Only react to the first ':' of the line state = SCE_MAKE_DEFAULT; } else if (lineBuffer[i] == '=') { - styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER); + if (lastNonSpace >= 0) + styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER); styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT); styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR); bSpecial = true; // Only react to the first '=' of the line @@ -415,7 +417,7 @@ static void ColouriseErrorListLine( break; } else if (((state == 11) || (state == 14)) && !((lineBuffer[i] == ' ') || isdigit(lineBuffer[i]))) { state = 99; - } else if ((state == 20) && (lineBuffer[i-1] == '\t') && + } else if ((state == 20) && (lineBuffer[i-1] == '\t') && ((lineBuffer[i] == '/' && lineBuffer[i+1] == '^') || isdigit(lineBuffer[i]))) { state = 24; break; @@ -423,7 +425,7 @@ static void ColouriseErrorListLine( state = 21; } else if ((state == 21) && ((lineBuffer[i] == '$') && (lineBuffer[i+1] == '/'))) { state = 22; - break; + break; } } if (state == 3) { @@ -431,7 +433,7 @@ static void ColouriseErrorListLine( } else if ((state == 13) || (state == 14) || (state == 15)) { styler.ColourTo(endPos, SCE_ERR_MS); } else if (((state == 22) || (state == 24)) && (lineBuffer[0] != '\t')) { - styler.ColourTo(endPos, SCE_ERR_CTAG); + styler.ColourTo(endPos, SCE_ERR_CTAG); } else { styler.ColourTo(endPos, SCE_ERR_DEFAULT); } |