Skip to content

Commit

Permalink
Update source text area UI
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed May 17, 2024
1 parent 3afea72 commit 9faadd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,11 @@ private fun Title(text: String) {
private fun sourceTextArea(focusTracker: FocusListener, explorerState: ExplorerState): SourceTextArea {
return SourceTextArea(explorerState.syncLines).apply {
configureSyntaxTextArea(SyntaxStyle.Kotlin, focusTracker)
SwingUtilities.invokeLater { requestFocusInWindow() }
isCodeFoldingEnabled = true
isMarginLineEnabled = true
marginLinePosition = 100
document.addDocumentListener(DocumentChangeListener { explorerState.sourceCode = text })
SwingUtilities.invokeLater { requestFocusInWindow() }
}
}

Expand Down Expand Up @@ -522,7 +525,6 @@ private fun performSwingMenuAction(actionType: Int) {

private fun RSyntaxTextArea.configureSyntaxTextArea(syntaxStyle: String, focusTracker: FocusListener) {
syntaxEditingStyle = syntaxStyle
isCodeFoldingEnabled = true
antiAliasingEnabled = true
tabsEmulated = true
tabSize = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SyntaxStyle private constructor() {
companion object {
val Dex: String get() = "text/dex-bytecode"
val ByteCode: String get() = "text/java-bytecode"
val Kotlin: String get() = "text/modified-kotlin"
val Kotlin: String get() = "text/kotlin"
val Oat: String get() = "text/oat-assembly"

init {
Expand Down

0 comments on commit 9faadd6

Please sign in to comment.