diff --git a/butterfly/static/main.js b/butterfly/static/main.js index ade3b8c..ffddf6e 100644 --- a/butterfly/static/main.js +++ b/butterfly/static/main.js @@ -459,7 +459,6 @@ Terminal.prototype.refresh = function(start, end) { var attr, bg, ch, classes, data, fg, flags, html, i, j, k, l, line, m, out, parent, ref, ref1, ref2, ref3, row, x; - console.log("Refresh " + start + " -> " + end); if (!this.native_scroll && end - start >= this.rows / 3) { parent = this.element.parentNode; if (parent != null) { @@ -613,11 +612,8 @@ var row; if (this.native_scroll) { if (this.scrollTop !== 0 || this.scrollBottom !== this.rows - 1) { - console.log('Non native scroll'); this.screen.splice(this.scrollTop, 1); this.screen.splice(this.scrollBottom, 0, this.blank_line()); - console.log(this.y); - this.y--; return this.maxRange(); } else { this.screen.shift(); @@ -1721,11 +1717,8 @@ var j, prevNode; if (this.native_scroll) { if (this.scrollTop !== 0 || this.scrollBottom !== this.rows - 1) { - console.log('Non native scroll'); this.screen.splice(this.scrollBottom, 1); this.screen.splice(this.scrollTop, 0, this.blank_line(true)); - console.log(this.y); - this.y--; this.maxRange(); } else { prevNode = this.children[0].previousElementSibling; @@ -2039,16 +2032,12 @@ row = this.y + this.ybase; while (param--) { this.screen.splice(row, 0, this.blank_line(true)); - if (this.native_scroll) { - this.screen.pop(); - } else { - j = this.rows - 1 - this.scrollBottom; - j = this.rows - 1 + this.ybase - j + 1; - this.screen.splice(j, 1); - } + j = this.rows - 1 - this.scrollBottom; + j = this.rows - 1 + this.ybase - j + 1; + this.screen.splice(j, 1); } this.updateRange(this.y); - return this.updateRange(this.native_scroll ? this.screen.length - 1 : this.scrollBottom); + return this.updateRange(this.scrollBottom); }; Terminal.prototype.deleteLines = function(params) { @@ -2069,7 +2058,7 @@ this.screen.splice(this.y, 1); } this.updateRange(this.y); - return this.updateRange(this.native_scroll ? this.screen.length - 1 : this.scrollBottom); + return this.updateRange(this.scrollBottom); }; Terminal.prototype.deleteChars = function(params) { @@ -2363,9 +2352,6 @@ Terminal.prototype.scrollUp = function(params) { var param; - if (this.native_scroll) { - return; - } param = params[0] || 1; while (param--) { this.screen.splice(this.ybase + this.scrollTop, 1); @@ -2377,9 +2363,6 @@ Terminal.prototype.scrollDown = function(params) { var param; - if (this.native_scroll) { - return; - } param = params[0] || 1; while (param--) { this.screen.splice(this.ybase + this.scrollBottom, 1); diff --git a/coffees/term.coffee b/coffees/term.coffee index 72bdb54..6e924cb 100644 --- a/coffees/term.coffee +++ b/coffees/term.coffee @@ -380,7 +380,6 @@ class Terminal refresh: (start, end) -> - console.log "Refresh #{start} -> #{end}" if not @native_scroll and end - start >= @rows / 3 parent = @element.parentNode parent?.removeChild @element @@ -498,11 +497,8 @@ class Terminal if @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 # inner scroll - console.log('Non native scroll') @screen.splice @scrollTop, 1 @screen.splice @scrollBottom, 0, @blank_line() - console.log(@y) - @y-- @maxRange() else @screen.shift() @@ -1617,11 +1613,8 @@ class Terminal if @native_scroll if @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 # inner scroll - console.log('Non native scroll') @screen.splice @scrollBottom, 1 @screen.splice @scrollTop, 0, @blank_line(true) - console.log(@y) - @y-- @maxRange() else prevNode = @children[0].previousElementSibling @@ -2030,15 +2023,12 @@ class Terminal while param-- @screen.splice row, 0, @blank_line(true) # blank_line(true) - xterm/linux behavior - if @native_scroll - @screen.pop() - else - j = @rows - 1 - @scrollBottom - j = @rows - 1 + @ybase - j + 1 - @screen.splice j, 1 + j = @rows - 1 - @scrollBottom + j = @rows - 1 + @ybase - j + 1 + @screen.splice j, 1 @updateRange @y - @updateRange if @native_scroll then @screen.length - 1 else @scrollBottom + @updateRange @scrollBottom # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). @@ -2059,7 +2049,7 @@ class Terminal @screen.splice @y, 1 @updateRange @y - @updateRange if @native_scroll then @screen.length - 1 else @scrollBottom + @updateRange @scrollBottom # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). @@ -2522,7 +2512,6 @@ class Terminal # CSI Ps S Scroll up Ps lines (default = 1) (SU). scrollUp: (params) -> - return if @native_scroll param = params[0] or 1 while param-- @screen.splice @ybase + @scrollTop, 1 @@ -2534,7 +2523,6 @@ class Terminal # CSI Ps T Scroll down Ps lines (default = 1) (SD). scrollDown: (params) -> - return if @native_scroll param = params[0] or 1 while param-- @screen.splice @ybase + @scrollBottom, 1