Merge pull request #2991 from Akarshit/bugFix-PgDnException

Fix for Exception when pressing PgDn in a code without scrollbar #2990
This commit is contained in:
Ben Fry
2015-04-01 16:12:33 -04:00

View File

@@ -865,9 +865,10 @@ public abstract class InputHandler extends KeyAdapter
int line = textArea.getCaretLine();
firstLine += visibleLines;
if(firstLine + visibleLines >= lineCount - 1)
firstLine = lineCount - visibleLines;
if (firstLine >= lineCount )
firstLine -= visibleLines;
else if(firstLine + visibleLines >= lineCount - 1)
firstLine = lineCount - visibleLines;
textArea.setFirstLine(firstLine);