Skip to content

Commit

Permalink
Preserve position without crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed Apr 25, 2024
1 parent e383596 commit 0a9b89c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private val AddressedPattern = Regex("(\\s+)([0-9a-fA-F]{4}): .+[\\n\\r]*")
internal fun updateTextArea(textArea: RSyntaxTextArea, text: String) {
val position = textArea.caretPosition
textArea.text = text
textArea.caretPosition = position
textArea.caretPosition = minOf(position, textArea.document.length)
}

class DexTextArea : RSyntaxTextArea() {
Expand Down

0 comments on commit 0a9b89c

Please sign in to comment.