mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 15:13:36 +00:00
Fix blanklines at start
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
4
butterfly/static/main.min.js
vendored
4
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user