Skip to content

Commit

Permalink
545754: OQL syntax highlighting sometimes doesn't highlight keywords
Browse files Browse the repository at this point in the history
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545754

Allow carriage return as well as line feed as separators.

Change-Id: I12295e024e8195ffcd50a3a9108066cd11820f30
  • Loading branch information
ajohnson1 committed Jul 16, 2019
1 parent 0c4e58b commit 8002fb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public String getPrefix(ITextViewer source, int currentPosition)
readChar = doc.getChar(pos);
pos--;
}
while (pos >= 0 && readChar != ' ' && readChar != '@' && readChar != '.' && readChar != '\n');
while (pos >= 0 && readChar != ' ' && readChar != '@' && readChar != '.' && readChar != '\n' && readChar != '\r');

if (readChar == ' ' || readChar == '\n' || readChar == '.')
if (readChar == ' ' || readChar == '\n' || readChar == '\r' ||readChar == '.')
pos++;
return doc.get(pos + 1, currentPosition - 1 - pos);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public OQLScanner(Color color)

public boolean isWordPart(char arg0)
{
return arg0 != ' ' && arg0 != '\n';
return arg0 != ' ' && arg0 != '\n' && arg0 != '\r';
}

public boolean isWordStart(char arg0)
Expand Down Expand Up @@ -69,7 +69,7 @@ public boolean isWordStart(char arg0)

public boolean isWordPart(char arg0)
{
return arg0 != ' ' && arg0 != '\n' && arg0 != ')' && arg0 != '!' && arg0 != '=';
return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != ')' && arg0 != '!' && arg0 != '=';
}

public boolean isWordStart(char arg0)
Expand All @@ -88,7 +88,7 @@ public boolean isWordStart(char arg0)

public boolean isWordPart(char arg0)
{
return arg0 != ' ' && arg0 != '\n' && arg0 != '(';
return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != '(';
}

public boolean isWordStart(char arg0)
Expand All @@ -111,7 +111,7 @@ public boolean isWordStart(char arg0)

public boolean isWordPart(char arg0)
{
return arg0 != ' ' && arg0 != '\n' && arg0 != '(';
return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != '(';
}

public boolean isWordStart(char arg0)
Expand All @@ -126,6 +126,7 @@ public boolean isWordStart(char arg0)
wr4.addWord("outbounds", tKeyWord); //$NON-NLS-1$
wr4.addWord("inbounds", tKeyWord); //$NON-NLS-1$
wr4.addWord("classof", tKeyWord); //$NON-NLS-1$
wr4.addWord("eval", tKeyWord); //$NON-NLS-1$

r[3] = wr4;

Expand Down

0 comments on commit 8002fb3

Please sign in to comment.