mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 11:34:05 +08:00
update files
This commit is contained in:
parent
31a181e6a3
commit
035dd499d6
@ -682,7 +682,7 @@ TChar.prototype.getAttributes = function (){
|
|||||||
blink: !!(bits & 8),
|
blink: !!(bits & 8),
|
||||||
inverse: !!(bits & 16),
|
inverse: !!(bits & 16),
|
||||||
conceal: !!(bits & 32),
|
conceal: !!(bits & 32),
|
||||||
//cursor: !!(bits & 64),
|
cursor: !!(bits & 64),
|
||||||
foreground: {
|
foreground: {
|
||||||
set: !!(colorbits & 4),
|
set: !!(colorbits & 4),
|
||||||
RGB: !!(colorbits & 8),
|
RGB: !!(colorbits & 8),
|
||||||
@ -1021,28 +1021,40 @@ AnsiTerminal.prototype.reset = function (){
|
|||||||
this.row_wrap = false;
|
this.row_wrap = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @return {string} String representation of active buffer. */
|
/**
|
||||||
AnsiTerminal.prototype.toString = function (){
|
* toSting
|
||||||
var j;
|
* @param [type]
|
||||||
|
* @returns {string} representation of active buffer.
|
||||||
|
*/
|
||||||
|
AnsiTerminal.prototype.toString = function (type){
|
||||||
|
var i, j;
|
||||||
var s = '';
|
var s = '';
|
||||||
|
|
||||||
for (var i = 0; i < this.screen.buffer.length; ++i) {
|
if (type === 'html') {
|
||||||
// FIXME: quick and dirty fill up from left
|
for (i = 0; i < this.screen.buffer.length; ++i) {
|
||||||
var last_nonspace = 0;
|
for (j = 0; j < this.screen.buffer[i].cells.length; ++j) {
|
||||||
|
console.log(this.screen.buffer[i].cells[j].getAttributes());
|
||||||
for (j = 0; j < this.screen.buffer[i].cells.length; ++j) {
|
|
||||||
if (this.screen.buffer[i].cells[j].c) {
|
|
||||||
last_nonspace = j;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < this.screen.buffer.length; ++i) {
|
||||||
|
// FIXME: quick and dirty fill up from left
|
||||||
|
var last_nonspace = 0;
|
||||||
|
|
||||||
for (j = 0; j < this.screen.buffer[i].cells.length; ++j) {
|
for (j = 0; j < this.screen.buffer[i].cells.length; ++j) {
|
||||||
s += (last_nonspace > j)
|
if (this.screen.buffer[i].cells[j].c) {
|
||||||
? (this.screen.buffer[i].cells[j].c || ' ')
|
last_nonspace = j;
|
||||||
: this.screen.buffer[i].cells[j].c;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = 0; j < this.screen.buffer[i].cells.length; ++j) {
|
||||||
|
s += (last_nonspace > j)
|
||||||
|
? (this.screen.buffer[i].cells[j].c || ' ')
|
||||||
|
: this.screen.buffer[i].cells[j].c;
|
||||||
|
}
|
||||||
|
|
||||||
|
s += '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
s += '\n';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user