From f951abb7a9a414a72cdff8de4657488de61ed8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Fri, 24 Jun 2016 16:25:00 +0200 Subject: [PATCH] wcwidth only for printables --- src/xterm.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 11e9855e..11b20ddc 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1388,7 +1388,7 @@ for (; i < width; i++) { data = line[i][0]; ch = line[i][1]; - ch_width = line[i][2] || 1; + ch_width = line[i][2]; if (!ch_width) continue; @@ -1490,7 +1490,6 @@ if (ch <= ' ') { out += ' '; } else { - if (ch_width==2) i++; out += ch; } break; @@ -1614,9 +1613,6 @@ if (0xDC00 <= code && code <= 0xDFFF) continue; - ch_width = wcswidth(code); - - switch (this.state) { case normal: switch (ch) { @@ -1672,6 +1668,8 @@ default: // ' ' + ch_width = wcswidth(code); // expensive, therefore we save the result in line buffer + if (ch >= ' ') { if (this.charset && this.charset[ch]) { ch = this.charset[ch]; @@ -4743,17 +4741,6 @@ return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47); } - function isWide(ch) { - if (ch <= '\uff00') return false; - return (ch >= '\uff01' && ch <= '\uffbe') - || (ch >= '\uffc2' && ch <= '\uffc7') - || (ch >= '\uffca' && ch <= '\uffcf') - || (ch >= '\uffd2' && ch <= '\uffd7') - || (ch >= '\uffda' && ch <= '\uffdc') - || (ch >= '\uffe0' && ch <= '\uffe6') - || (ch >= '\uffe8' && ch <= '\uffee'); - } - function matchColor(r1, g1, b1) { var hash = (r1 << 16) | (g1 << 8) | b1;