Fix rendering width of ideographic space (U+3000)

This commit is contained in:
Joe Cheng 2011-08-10 01:48:04 -07:00
commit e607ee24a3

View file

@ -349,6 +349,13 @@ var Text = function(parentEl) {
return "&";
} else if (c == "<") {
return "&lt;";
} else if (c == "\u3000") {
// U+3000 is both invisible AND full-width, so must be handled uniquely
var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk";
screenColumn += 1;
return "<span class='" + classToUse + "' style='width:" +
(self.config.characterWidth * 2) +
"px'>" + c + "</span>";
} else if (c.match(/[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/)) {
if (self.showInvisibles) {
var space = new Array(c.length+1).join(self.SPACE_CHAR);