Skip to content

Commit 8471576

Browse files
author
Bytekeeper
committed
1 parent a5bfab1 commit 8471576

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/org/stt/gui/jfx/text/CommandHighlighter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public void update() {
2525
EnglishCommandsLexer lexer = new EnglishCommandsLexer(input);
2626
TokenStream tokenStream = new CommonTokenStream(lexer);
2727
EnglishCommandsParser parser = new EnglishCommandsParser(tokenStream);
28-
textArea.clearStyle(0, textArea.getLength());
28+
if (textArea.getLength() > 0) {
29+
textArea.clearStyle(0, textArea.getLength());
30+
}
2931
parser.command().accept(visitor);
3032
}
3133

0 commit comments

Comments
 (0)