+ fix: minor issues

This commit is contained in:
Rainer Kottenhoff 2018-03-23 01:08:14 +01:00
parent ca3f8a07ca
commit 9002b5555e
3 changed files with 10 additions and 12 deletions

View File

@ -47,7 +47,7 @@ static bool IsBOperator(char ch) {
// Tests for BATCH Separators
static bool IsBSeparator(char ch) {
return (ch == '\\') || (ch == '.') || (ch == ';') ||
(ch == '\"') || (ch == '\'') || (ch == '/');
(ch == '\"') || (ch == '\'') || (ch == '/') || (ch == '&') || (ch == '|');
}
static void ColouriseBatchLine(
@ -131,9 +131,8 @@ static void ColouriseBatchLine(
}
wordBuffer[wbl] = '\0';
wbo = 0;
// Check for Comment - return if found
if (CompareCaseInsensitive(wordBuffer, "rem") == 0) {
if ((CompareCaseInsensitive(wordBuffer, "rem") == 0) && (continueProcessing)) {
styler.ColourTo(endPos, SCE_BAT_COMMENT);
return;
}
@ -141,9 +140,9 @@ static void ColouriseBatchLine(
if (IsBSeparator(wordBuffer[0])) {
// Check for External Command / Program
if ((cmdLoc == offset - wbl) &&
((wordBuffer[0] == ':') ||
(wordBuffer[0] == '\\') ||
(wordBuffer[0] == '.'))) {
((wordBuffer[0] == ':') ||
(wordBuffer[0] == '\\') ||
(wordBuffer[0] == '.'))) {
// Reset Offset to re-process remainder of word
offset -= (wbl - 1);
// Colorize External Command / Program
@ -163,8 +162,7 @@ static void ColouriseBatchLine(
styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
}
// Check for Regular Keyword in list
} else if ((keywords.InList(wordBuffer)) &&
(continueProcessing)) {
} else if ((keywords.InList(wordBuffer)) && (continueProcessing)) {
// ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking
if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) ||
(CompareCaseInsensitive(wordBuffer, "goto") == 0) ||
@ -211,8 +209,7 @@ static void ColouriseBatchLine(
// Check for Special Keyword in list, External Command / Program, or Default Text
} else if ((wordBuffer[0] != '%') &&
(wordBuffer[0] != '!') &&
(!IsBOperator(wordBuffer[0])) &&
(continueProcessing)) {
(!IsBOperator(wordBuffer[0])) && (continueProcessing)) {
// Check for Special Keyword
// Affected Commands are in Length range 2-6
// Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected
@ -454,6 +451,7 @@ static void ColouriseBatchLine(
while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
offset++;
}
}
// Colorize Default Text for remainder of line - currently not lexed
styler.ColourTo(endPos, SCE_BAT_DEFAULT);

View File

@ -6606,8 +6606,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return view.posCache.GetSize();
case SCI_SETSCROLLWIDTH:
PLATFORM_ASSERT(wParam >= 0);
if ((wParam >= 0) && (wParam != static_cast<unsigned int >(scrollWidth))) {
PLATFORM_ASSERT(wParam > 0);
if ((wParam > 0) && (wParam != static_cast<unsigned int >(scrollWidth))) {
view.lineWidthMaxSeen = 0;
scrollWidth = static_cast<int>(wParam);
SetScrollBars();

Binary file not shown.