New editor: setForeground doesn't change default text color, "IDENTIFIER" token style does the job. Fixes #3372

This commit is contained in:
Federico Fissore 2015-06-22 09:01:55 +02:00
parent 9089fecbe4
commit ee006271d8
1 changed files with 5 additions and 2 deletions

View File

@ -106,7 +106,6 @@ public class SketchTextArea extends RSyntaxTextArea {
IOUtils.closeQuietly(defaultXmlInputStream);
}
setForeground(processing.app.Theme.getColor("editor.fgcolor"));
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
setCaretColor(processing.app.Theme.getColor("editor.caret.color"));
@ -129,6 +128,10 @@ public class SketchTextArea extends RSyntaxTextArea {
setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean");
setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char");
setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER);
style.foreground = processing.app.Theme.getColor("editor.fgcolor");
getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style);
}
private void setSyntaxTheme(int tokenType, String id) {
@ -391,7 +394,7 @@ public class SketchTextArea extends RSyntaxTextArea {
// Copy token, viewToModel() unfortunately modifies Token
t = new TokenImpl(t);
}
Cursor c2 = null;
Cursor c2;
if (t != null && t.isHyperlink()) {
if (hoveredOverLinkOffset == -1 ||
hoveredOverLinkOffset != t.getOffset()) {