Skip to content

Commit 06c5431

Browse files
authored
Update JavaKeywordsDemo.java (#962)
1 parent dc34093 commit 06c5431

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywordsDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void accept( ListModification lm )
178178
{
179179
if ( lm.getAddedSize() > 0 )
180180
{
181-
int paragraph = area.visibleParToAllParIndex( lm.getFrom() );
181+
int paragraph = Math.min( area.firstVisibleParToAllParIndex() + lm.getFrom(), area.getParagraphs().size()-1 );
182182
String text = area.getText( paragraph, 0, paragraph, area.getParagraphLength( paragraph ) );
183183

184184
if ( paragraph != prevParagraph || text.length() != prevTextLength )

0 commit comments

Comments
 (0)