Skip to content

Commit

Permalink
Limit max horizontal viewport size to 1 less row than fits on page
Browse files Browse the repository at this point in the history
Mirrors our limitation that shrinking is limited to 1 row total
  • Loading branch information
slusarz committed Apr 22, 2014
1 parent ee87e97 commit 204726f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions imp/js/viewport.js
Expand Up @@ -1071,7 +1071,7 @@ var ViewPort = Class.create({
// return: (integer) Number of rows in current view.
getPageSize: function(type)
{
var h;
var h, lh;

switch (type) {
case 'current':
Expand All @@ -1084,10 +1084,11 @@ var ViewPort = Class.create({

case 'max':
h = document.viewport.getHeight() - this.opts.content.viewportOffset()[1];
lh = this._getLineHeight();
if (this.split_pane.currbar && this.pane_mode == 'horiz') {
h -= this.split_pane.currbar.getHeight() + 2;
h -= this.split_pane.currbar.getHeight() + lh;
}
return parseInt(h / this._getLineHeight(), 10);
return parseInt(h / lh, 10);

default:
return this.page_size;
Expand Down

0 comments on commit 204726f

Please sign in to comment.