Skip to content

Commit ee00627

Browse files
author
Federico Fissore
committed
New editor: setForeground doesn't change default text color, "IDENTIFIER" token style does the job. Fixes #3372
1 parent 9089fec commit ee00627

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/processing/app/syntax/SketchTextArea.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ private void setTheme(String name) throws IOException {
106106
IOUtils.closeQuietly(defaultXmlInputStream);
107107
}
108108

109-
setForeground(processing.app.Theme.getColor("editor.fgcolor"));
110109
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
111110
setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
112111
setCaretColor(processing.app.Theme.getColor("editor.caret.color"));
@@ -129,6 +128,10 @@ private void setTheme(String name) throws IOException {
129128
setSyntaxTheme(TokenTypes.LITERAL_BOOLEAN, "literal_boolean");
130129
setSyntaxTheme(TokenTypes.LITERAL_CHAR, "literal_char");
131130
setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
131+
132+
Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER);
133+
style.foreground = processing.app.Theme.getColor("editor.fgcolor");
134+
getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style);
132135
}
133136

134137
private void setSyntaxTheme(int tokenType, String id) {
@@ -391,7 +394,7 @@ public void mouseMoved(MouseEvent e) {
391394
// Copy token, viewToModel() unfortunately modifies Token
392395
t = new TokenImpl(t);
393396
}
394-
Cursor c2 = null;
397+
Cursor c2;
395398
if (t != null && t.isHyperlink()) {
396399
if (hoveredOverLinkOffset == -1 ||
397400
hoveredOverLinkOffset != t.getOffset()) {

0 commit comments

Comments
 (0)