Fix blanklines at start

This commit is contained in:
Florian Mounier
2015-05-12 11:27:55 +02:00
parent 060a2666b5
commit 7d8f3b2845
3 changed files with 16 additions and 8 deletions

View File

@@ -261,7 +261,7 @@
i = this.rows;
this.shift = 0;
while (i--) {
this.screen.push(this.blankLine());
this.screen.push(this.blankLine(false, false));
}
this.setupStops();
return this.skipNextKey = null;
@@ -770,6 +770,7 @@
case "\n":
case "\x0b":
case "\x0c":
this.screen[this.y + this.shift].dirty = true;
this.nextLine();
break;
case "\r":
@@ -1731,8 +1732,14 @@
return this.eraseRight(0, y);
};
Terminal.prototype.blankLine = function(cur) {
Terminal.prototype.blankLine = function(cur, dirty) {
var attr, i, line;
if (cur == null) {
cur = false;
}
if (dirty == null) {
dirty = true;
}
attr = (cur ? this.eraseAttr() : this.defAttr);
line = [];
i = 0;
@@ -1742,7 +1749,7 @@
}
return {
chars: line,
dirty: false,
dirty: dirty,
wrap: false
};
};

File diff suppressed because one or more lines are too long

View File

@@ -169,7 +169,7 @@ class Terminal
@screen = []
i = @rows
@shift = 0
@screen.push @blankLine() while i--
@screen.push @blankLine(false, false) while i--
@setupStops()
@skipNextKey = null
@@ -600,6 +600,7 @@ class Terminal
# '\n', '\v', '\f'
when "\n", "\x0b", "\x0c"
# @x = 0 if @convertEol
@screen[@y + @shift].dirty = true
@nextLine()
# '\r'
@@ -1585,7 +1586,7 @@ class Terminal
eraseLine: (y) ->
@eraseRight 0, y
blankLine: (cur) ->
blankLine: (cur=false, dirty=true) ->
attr = (if cur then @eraseAttr() else @defAttr)
line = []
i = 0
@@ -1594,7 +1595,7 @@ class Terminal
i++
chars: line
dirty: false
dirty: dirty
wrap: false
ch: (cur) ->