hterm: differentiate between non-ASCII and wide-characters
We need to treat strings specially when they're non-ASCII and not
just when wide characters. i.e. When we're dealing with combining
codepoints. Add an ASCII node property to the text nodes so we
can differentiate the states.
This doesn't fully fix combining characters, but should at least
improve things. For example, they're still broken with wide chars.
BUG=chromium:654839
Change-Id: I4caeeadda4da019c557ea51e7e9fff4ec6634ef9
Reviewed-on: https://chromium-review.googlesource.com/615984
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index a7f8506..d47bc11 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -1716,8 +1716,8 @@
var tokens = hterm.TextAttributes.splitWidecharString(substr);
for (var i = 0; i < tokens.length; i++) {
- if (tokens[i].wcNode)
- this.screen_.textAttributes.wcNode = true;
+ this.screen_.textAttributes.wcNode = tokens[i].wcNode;
+ this.screen_.textAttributes.asciiNode = tokens[i].asciiNode;
if (this.options_.insertMode) {
this.screen_.insertString(tokens[i].str);
@@ -1725,6 +1725,7 @@
this.screen_.overwriteString(tokens[i].str);
}
this.screen_.textAttributes.wcNode = false;
+ this.screen_.textAttributes.asciiNode = true;
}
this.screen_.maybeClipCurrentRow();