Merge pull request +8179 from c9/fix/various

Fix several small issues
pull/117/merge
Lennart Kats 2015-07-09 11:39:44 +02:00
commit 15720a1fc0
3 zmienionych plików z 20 dodań i 5 usunięć

Wyświetl plik

@ -131,7 +131,11 @@ define(function(require, module, exports) {
function removeTab(e) { function removeTab(e) {
if (!e.error) { if (!e.error) {
var tab = findTab(e.path); var tab = findTab(e.path);
tab && tab.unload(); if (tab) {
tab.document.meta.$ignoreSave = true;
tab.close();
delete tab.document.meta.$ignoreSave;
}
} }
} }
fs.on("afterUnlink", removeTab); fs.on("afterUnlink", removeTab);

Wyświetl plik

@ -113,8 +113,11 @@ define(function(require, exports, module) {
for (var l = Math.min(line.length, term.cols); l--;) for (var l = Math.min(line.length, term.cols); l--;)
if (line[l][1]) if (line[l][1])
break; break;
for (var i = 0; i <= l; i++) for (var i = 0; i <= l; i++) {
str += line[i][1] || " "; var ch = line[i][1];
if (ch != "\x00")
str += line[i][1] || " ";
}
if (newLineChar && !line.wrapped) if (newLineChar && !line.wrapped)
str += newLineChar; str += newLineChar;
@ -546,7 +549,7 @@ define(function(require, exports, module) {
if (ch <= ' ') if (ch <= ' ')
out += '\xa0'; out += ch == "\x00" ? "" : "\xa0";
else if (ch == '&') else if (ch == '&')
out += '&#38;'; out += '&#38;';
else if (ch == '<') else if (ch == '<')

Wyświetl plik

@ -458,6 +458,11 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
var width = ch > "\x7f" ? wc.charWidth(ch.charCodeAt(0)) : 1; var width = ch > "\x7f" ? wc.charWidth(ch.charCodeAt(0)) : 1;
line = lines[insertY]; line = lines[insertY];
var x = this.x;
while (line[x] && !line[x][1] && x > 0) {
line[x] = [line[x][0], " "];
x--;
}
switch (width) { switch (width) {
case 1: case 1:
if (!this.insertMode) if (!this.insertMode)
@ -472,7 +477,7 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
case 2: case 2:
if (!this.insertMode) { if (!this.insertMode) {
line[this.x] = [this.curAttr, ch]; line[this.x] = [this.curAttr, ch];
line[this.x + 1] = [this.curAttr, ""]; line[this.x + 1] = [this.curAttr, "\x00"];
} else { } else {
line[insertY].splice(this.x, 0, [this.curAttr, ch], [this.curAttr, ""]); line[insertY].splice(this.x, 0, [this.curAttr, ch], [this.curAttr, ""]);
} }
@ -700,6 +705,9 @@ Terminal.prototype.writeInternal = function(data) {//TODO optimize lines
// change log file // change log file
break; break;
case 50: case 50:
var args = this.params[1].match(/CursorShape=(.)/i);
var shape = ['BLOCK', 'BEAM', 'UNDERLINE'][parseInt(args && args[1]) || 0];
// TODO cursor shape
// dynamic font // dynamic font
break; break;
case 51: case 51: