Skip to content

Commit

Permalink
don't set styleranges that exceed the document's length
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed Jan 20, 2014
1 parent b01a7e1 commit 51133e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public void documentChanged(final DocumentEvent event) {
int lineCount = textWidget.getLineCount();
textWidget.setTopIndex(lineCount - 1);
StyleRange styleRange = getDocument().getCurrentStyleRange();
if (styleRange != null) {
textWidget.setStyleRange(styleRange);
if (styleRange != null && event.getLength() == 0) {
textWidget.setStyleRange(styleRange);
}
}
}
Expand Down

0 comments on commit 51133e3

Please sign in to comment.