1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

New editor: restored EOL markers. Fixes #3817

This commit is contained in:
Federico Fissore 2015-09-18 09:18:40 +02:00
parent a63d8d0bae
commit c3c59f2359

View File

@ -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) {