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:
parent
a63d8d0bae
commit
c3c59f2359
@ -101,6 +101,7 @@ public class SketchTextArea extends RSyntaxTextArea {
|
|||||||
IOUtils.closeQuietly(defaultXmlInputStream);
|
IOUtils.closeQuietly(defaultXmlInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setEOLMarkersVisible(processing.app.Theme.getBoolean("editor.eolmarkers"));
|
||||||
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
|
setBackground(processing.app.Theme.getColor("editor.bgcolor"));
|
||||||
setHighlightCurrentLine(processing.app.Theme.getBoolean("editor.linehighlight"));
|
setHighlightCurrentLine(processing.app.Theme.getBoolean("editor.linehighlight"));
|
||||||
setCurrentLineHighlightColor(processing.app.Theme.getColor("editor.linehighlight.color"));
|
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.LITERAL_STRING_DOUBLE_QUOTE, "literal_string_double_quote");
|
||||||
setSyntaxTheme(TokenTypes.PREPROCESSOR, "preprocessor");
|
setSyntaxTheme(TokenTypes.PREPROCESSOR, "preprocessor");
|
||||||
|
|
||||||
Style style = getSyntaxScheme().getStyle(TokenTypes.IDENTIFIER);
|
setColorForToken(TokenTypes.IDENTIFIER, "editor.fgcolor");
|
||||||
style.foreground = processing.app.Theme.getColor("editor.fgcolor");
|
setColorForToken(TokenTypes.WHITESPACE, "editor.eolmarkers.color");
|
||||||
getSyntaxScheme().setStyle(TokenTypes.IDENTIFIER, style);
|
}
|
||||||
|
|
||||||
|
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) {
|
private void setSyntaxTheme(int tokenType, String id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user