Hardle diacritical marks

This commit is contained in:
Florian Mounier
2015-05-18 17:26:27 +02:00
parent 8c3c780b12
commit 4e66196d65
4 changed files with 39 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -761,7 +761,7 @@
};
Terminal.prototype.write = function(data) {
var attr, b64, c, ch, content, cs, i, k, l, len, line, m, mime, num, pt, ref, ref1, ref2, ref3, safe, type, valid;
var attr, b64, c, ch, content, cs, i, k, l, len, line, m, mime, num, pt, ref, ref1, ref2, ref3, safe, type, valid, x, y;
i = 0;
l = data.length;
while (i < l) {
@@ -802,6 +802,20 @@
this.state = State.escaped;
break;
default:
if (("\u0300" <= ch && ch <= "\u036F") || ("\u1AB0" <= ch && ch <= "\u1AFF") || ("\u1DC0" <= ch && ch <= "\u1DFF") || ("\u20D0" <= ch && ch <= "\u20FF") || ("\uFE20" <= ch && ch <= "\uFE2F")) {
x = this.x;
y = this.y + this.shift;
if (this.x > 0) {
x -= 1;
} else if (this.y > 0) {
y -= 1;
x = this.cols - 1;
} else {
break;
}
this.screen[y].chars[x].ch += ch;
break;
}
if (ch >= " ") {
if ((ref = this.charset) != null ? ref[ch] : void 0) {
ch = this.charset[ch];

File diff suppressed because one or more lines are too long

View File

@@ -630,7 +630,26 @@ class Terminal
@state = State.escaped
else
# ' '
# Diacritical Marks
if ("\u0300" <= ch <= "\u036F" or
"\u1AB0" <= ch <= "\u1AFF" or
"\u1DC0" <= ch <= "\u1DFF" or
"\u20D0" <= ch <= "\u20FF" or
"\uFE20" <= ch <= "\uFE2F")
x = @x
y = @y + @shift
if @x > 0
x -= 1
else if @y > 0
y -= 1
x = @cols - 1
else
# ?!
break
@screen[y].chars[x].ch += ch
break
if ch >= " "
ch = @charset[ch] if @charset?[ch]
if @x >= @cols