Skip to content

Commit

Permalink
Update syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed May 8, 2024
1 parent 13cd4b2 commit 6fb33d1
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ private fun RSyntaxTextArea.configureSyntaxTextArea(syntaxStyle: String, focusTr

private fun applyTheme(textArea: RSyntaxTextArea) {
try {
val theme = Theme.load(RSyntaxTextArea::class.java.getResourceAsStream(
"/org/fife/ui/rsyntaxtextarea/themes/idea.xml")
val theme = Theme.load(UiState::class.java.getResourceAsStream(
"/themes/kotlin_explorer.xml")
)
theme.apply(textArea)
} catch (ioe: IOException) {
Expand Down
70 changes: 70 additions & 0 deletions src/jvmMain/resources/themes/kotlin_explorer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE RSyntaxTheme SYSTEM "theme.dtd">

<RSyntaxTheme version="1.0">
<!-- General editor colors. -->
<background color="ffffff" />
<caret color="000000" />
<selection fg="ffffff" bg="526da5" />
<currentLineHighlight color="f5f8fe" fade="false" />
<marginLine fg="b0b4b9" />
<markAllHighlight color="edebfc" />
<markOccurrencesHighlight color="edebfc" border="false" />
<matchedBracket fg="93d9d9" bg="93d9d9" highlightBoth="true" animate="false" />
<hyperlinks fg="0000ff" />
<secondaryLanguages>
<language index="1" bg="fff0cc" />
<language index="2" bg="dafeda" />
<language index="3" bg="ffe0f0" />
</secondaryLanguages>

<!-- Gutter styling. -->
<gutterBorder color="dddddd" />
<lineNumbers fg="787878" />
<foldIndicator fg="808080" armedFg="585858" iconBg="ffffff" />
<iconRowHeader activeLineRange="3399ff" />

<!-- Syntax tokens. -->
<tokenStyles>
<style token="IDENTIFIER" fg="000000" />
<style token="RESERVED_WORD" fg="0033b3" />
<style token="RESERVED_WORD_2" fg="0033b3" />
<style token="ANNOTATION" fg="9e880d" />
<style token="COMMENT_DOCUMENTATION" fg="8c8c8c" italic="true" />
<style token="COMMENT_EOL" fg="8c8c8c" italic="true" />
<style token="COMMENT_MULTILINE" fg="8c8c8c" italic="true" />
<style token="COMMENT_KEYWORD" fg="8c8c8c" underline="true" italic="true" />
<style token="COMMENT_MARKUP" fg="8c8c8c" bg="e2ffe2" italic="true" />
<style token="DATA_TYPE" fg="871094" />
<style token="FUNCTION" fg="00627a" />
<style token="LITERAL_BOOLEAN" fg="000080" />
<style token="LITERAL_NUMBER_DECIMAL_INT" fg="1750eb" />
<style token="LITERAL_NUMBER_FLOAT" fg="1750eb" />
<style token="LITERAL_NUMBER_HEXADECIMAL" fg="1750eb" />
<style token="LITERAL_STRING_DOUBLE_QUOTE" fg="067d17" />
<style token="LITERAL_CHAR" fg="067d17" />
<style token="LITERAL_BACKQUOTE" fg="067d17" bg="ffcccc" />
<style token="MARKUP_TAG_DELIMITER" fg="000000" bold="true" />
<style token="MARKUP_TAG_NAME" fg="000080" bold="true" />
<style token="MARKUP_TAG_ATTRIBUTE" fg="0000ff" bold="true" />
<style token="MARKUP_TAG_ATTRIBUTE_VALUE" fg="008000" bold="true" />
<style token="MARKUP_COMMENT" fg="808080" italic="true"/>
<style token="MARKUP_DTD" fg="808080"/>
<style token="MARKUP_PROCESSING_INSTRUCTION" fg="808080"/>
<style token="MARKUP_CDATA" fg="cc6600"/>
<style token="MARKUP_CDATA_DELIMITER" fg="008080"/>
<style token="MARKUP_ENTITY_REFERENCE" fg="008000"/>
<style token="OPERATOR" fg="000000" />
<style token="PREPROCESSOR" fg="808080" />
<style token="REGEX" fg="871094" />
<style token="SEPARATOR" fg="000000" />
<style token="VARIABLE" fg="871094" />
<style token="WHITESPACE" fg="000000" />

<style token="ERROR_IDENTIFIER" fg="ff0000" />
<style token="ERROR_NUMBER_FORMAT" fg="ff0000" />
<style token="ERROR_STRING_DOUBLE" fg="ff0000" />
<style token="ERROR_CHAR" fg="ff0000" />
</tokenStyles>

</RSyntaxTheme>

0 comments on commit 6fb33d1

Please sign in to comment.