From 758eef133c535f952fde961e034176f0756fbc53 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 26 Apr 2015 04:16:47 -0700 Subject: [PATCH] stop double-width chars from breaking words when wrapped. --- lib/widget.js | 2 +- test/widget-eaw.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index c61d3eb..803ff4a 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2424,7 +2424,7 @@ Element.prototype.parseContent = function(noTags) { if (this.screen.fullUnicode) { // double-width chars will eat the next char after render. create a // blank character after it so it doesn't eat the real next char. - content = content.replace(unicode.wideChars, '$1 '); + content = content.replace(unicode.wideChars, '$1_'); } else { // no double-width: replace them with question-marks. content = content.replace(unicode.wideChars, '??'); diff --git a/test/widget-eaw.js b/test/widget-eaw.js index 55329ba..4495bbe 100644 --- a/test/widget-eaw.js +++ b/test/widget-eaw.js @@ -24,11 +24,11 @@ var JUAN = '鹃'; // ? String.fromCodePoint(0x675c) // : String.fromCharCode(0x675c); -// var DOUBLE = DU; +var DOUBLE = DU; // var DOUBLE = String.fromCodePoint(0x1F250); // one flew over the 杜鹃's nest. -var DOUBLE = DU + JUAN; +// var DOUBLE = DU + JUAN; // var SURROGATE_DOUBLE = '𰀀'; var SURROGATE_DOUBLE = String.fromCodePoint