From c3c59f2359b052f29b53f9f71b8fe4ac4c292233 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 18 Sep 2015 09:18:40 +0200 Subject: [PATCH] New editor: restored EOL markers. Fixes #3817 --- app/src/processing/app/syntax/SketchTextArea.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/syntax/SketchTextArea.java b/app/src/processing/app/syntax/SketchTextArea.java index 457e17b87..c546be878 100644 --- a/app/src/processing/app/syntax/SketchTextArea.java +++ b/app/src/processing/app/syntax/SketchTextArea.java @@ -101,6 +101,7 @@ public class SketchTextArea extends RSyntaxTextArea { IOUtils.closeQuietly(defaultXmlInputStream); } + setEOLMarkersVisible(processing.app.Theme.getBoolean("editor.eolmarkers")); setBackground(processing.app.Theme.getColor("editor.bgcolor")); setHighlightCurrentLine(processing.app.Theme.getBoolean("editor.linehighlight")); setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color")); @@ -127,9 +128,14 @@ public class SketchTextArea extends RSyntaxTextArea { setSyntaxTheme(TokenTypes.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote"); setSyntaxTheme(TokenTypes.PREPROCESSOR, "preprocessor"); - Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER); - style.foreground = processing.app.Theme.getColor("editor.fgcolor"); - getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style); + setColorForToken(TokenTypes.IDENTIFIER, "editor.fgcolor"); + setColorForToken(TokenTypes.WHITESPACE, "editor.eolmarkers.color"); + } + + private void setColorForToken(int tokenType, String colorKeyFromTheme) { + Style style = getSyntaxScheme().getStyle(tokenType); + style.foreground = processing.app.Theme.getColor(colorKeyFromTheme); + getSyntaxScheme().setStyle(tokenType, style); } private void setSyntaxTheme(int tokenType, String id) {