Skip to content

Commit

Permalink
Merge pull request #2991 from Akarshit/bugFix-PgDnException
Browse files Browse the repository at this point in the history
Fix for Exception when pressing PgDn in a code without scrollbar #2990
  • Loading branch information
benfry committed Apr 1, 2015
2 parents 17e2be5 + 2c695ec commit 3f30d85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/processing/app/syntax/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,10 @@ public void actionPerformed(ActionEvent evt)
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);

Expand Down

0 comments on commit 3f30d85

Please sign in to comment.