display non regular whitespace in show invisibles
This commit is contained in:
parent
f9d03eed7b
commit
bd7b145a7f
1 changed files with 15 additions and 10 deletions
|
|
@ -248,18 +248,23 @@ var Text = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$renderLine = function(stringBuilder, row, tokens) {
|
this.$renderLine = function(stringBuilder, row, tokens) {
|
||||||
// if (this.showInvisibles) {
|
if (this.showInvisibles) {
|
||||||
// var self = this;
|
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 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 spaceReplace = function(space) {
|
||||||
// var space = new Array(space.length+1).join(self.SPACE_CHAR);
|
if (space.charCodeAt(0) == 32)
|
||||||
// return "<span class='ace_invisible'>" + space + "</span>";
|
return new Array(space.length+1).join(" ");
|
||||||
// };
|
else {
|
||||||
// }
|
var space = new Array(space.length+1).join(self.SPACE_CHAR);
|
||||||
// else {
|
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 spaceRe = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g;
|
||||||
var spaceReplace = " ";
|
var spaceReplace = " ";
|
||||||
// }
|
}
|
||||||
|
|
||||||
for ( var i = 0; i < tokens.length; i++) {
|
for ( var i = 0; i < tokens.length; i++) {
|
||||||
var token = tokens[i];
|
var token = tokens[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue