+ fix: batch lexer: handle comment after ampersand(&) command sequence

This commit is contained in:
Rainer Kottenhoff 2019-10-09 09:42:43 +02:00
parent bab4b9f8f0
commit 4d98974ad3
4 changed files with 29 additions and 6 deletions

View File

@ -1 +1 @@
2657
2658

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.1001.2657"
version="5.19.1009.2658"
type="win32"
/>
<description>Notepad3 BETA</description>

View File

@ -137,6 +137,29 @@ static void ColouriseBatchLine(
styler.ColourTo(endPos, SCE_BAT_COMMENT);
return;
}
else if ((wbl > 2) && (wordBuffer[0] == '&') && (wordBuffer[1] == ':') && (wordBuffer[2] == ':') && (continueProcessing)) {
styler.ColourTo(endPos, SCE_BAT_COMMENT);
return;
}
else if (wordBuffer[0] == '&') {
// check for comment
Sci_PositionU cmntLoc = offset - wbl + 1;
// Skip next spaces
while ((cmntLoc < lengthLine) &&
(isspacechar(lineBuffer[cmntLoc]))) {
cmntLoc++;
}
int p = 0;
char buffer[5];
while ((cmntLoc < lengthLine) && (p < 4)) {
buffer[p++] = lineBuffer[cmntLoc++];
}
buffer[p] = '\0';
if ((((buffer[0] == ':') && (buffer[1] == ':')) || (CompareCaseInsensitive(buffer, "rem ") == 0)) && (continueProcessing)) {
styler.ColourTo(endPos, SCE_BAT_COMMENT);
return;
}
}
// Check for Separator
if (IsBSeparator(wordBuffer[0])) {
// Check for External Command / Program
@ -147,7 +170,7 @@ static void ColouriseBatchLine(
// Reset Offset to re-process remainder of word
offset -= (wbl - 1);
// Colorize External Command / Program
if (!keywords2) {
if (!keywords2) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else if (keywords2.InList(wordBuffer)) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);

View File

@ -7,10 +7,10 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 19
#define VERSION_REV 1001
#define VERSION_BUILD 2657
#define VERSION_REV 1009
#define VERSION_BUILD 2658
#define SCINTILLA_VER 420
#define ONIGURUMA_REGEX_VER 6.9.3
#define ONIGURUMA_REGEX_VER 6.9.4
#define UCHARDET_VER 2018.09.27
#define TINYEXPR_VER 2018.05.11
#define UTHASH_VER 2.1.0