From b97496009b800e843c91893da374cf886b0a420f Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 7 Jul 2013 12:48:53 +0400 Subject: [PATCH] scrollPastEnd --- lib/ace/virtual_renderer.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 6ed5a01d..b70d6906 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -848,7 +848,7 @@ var VirtualRenderer = function(container, theme) { var hideScrollbars = this.$size.height <= 2 * this.lineHeight; var screenLines = this.session.getScreenLength() - var maxHeight = screenLines * this.lineHeight; + var maxHeight = screenLines * this.lineHeight; var offset = this.scrollTop % this.lineHeight; var minHeight = this.$size.scrollerHeight + this.lineHeight; @@ -864,6 +864,9 @@ var VirtualRenderer = function(container, theme) { this.scrollBarH.setVisible(horizScroll); } + if (!this.$maxLines && this.$scrollPastEnd) + maxHeight += (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd; + var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || this.$size.scrollerHeight - maxHeight < 0); var vScrollChanged = this.$vScroll !== vScroll; @@ -1579,9 +1582,23 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", { } }, minLines: { - set: function(name) { + set: function(val) { this.updateFull(); } + }, + scrollPastEnd: { + set: function(val) { + if (val == true) + val = 1; + else if (val == false) + val = 0; + if (this.$scrollPastEnd == val) + return; + this.$scrollPastEnd = val; + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: 1, + handlesSet: true } });