spaces are not treated as invisibles (matches textmate)

This commit is contained in:
Fabian Jakobs 2010-10-25 16:40:18 +02:00
commit 38be2616aa

View file

@ -221,18 +221,18 @@ var Text = function(parentEl) {
};
this.$renderLine = function(stringBuilder, row, tokens) {
if (this.$showInvisibles) {
var self = this;
var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+/g;
var spaceReplace = function(space) {
var space = new Array(space.length+1).join(self.SPACE_CHAR);
return "<span class='ace_invisible'>" + space + "</span>";
};
}
else {
// if (this.$showInvisibles) {
// var self = this;
// var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+/g;
// var spaceReplace = function(space) {
// var space = new Array(space.length+1).join(self.SPACE_CHAR);
// return "<span class='ace_invisible'>" + space + "</span>";
// };
// }
// else {
var spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;
var spaceReplace = "&nbsp;";
}
// }
for ( var i = 0; i < tokens.length; i++) {
var token = tokens[i];