From dc874839361caa0e4804927b52e40d3513d8d1f2 Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Fri, 14 Mar 2014 22:14:45 -0700 Subject: [PATCH 1/4] Increase granularity of invisible character classes. --- lib/ace/layer/text.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index fd81f5ff..0952577e 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -126,7 +126,7 @@ var Text = function(parentEl) { var tabStr = this.$tabStrings = [0]; for (var i = 1; i < tabSize + 1; i++) { if (this.showInvisibles) { - tabStr.push("" + tabStr.push("" + this.TAB_CHAR + lang.stringRepeat("\xa0", i - 1) + ""); @@ -321,7 +321,7 @@ var Text = function(parentEl) { var replaceFunc = function(c, a, b, tabIdx, idx4) { if (a) { return self.showInvisibles ? - "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" : + "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" : lang.stringRepeat("\xa0", c.length); } else if (c == "&") { return "&"; @@ -333,14 +333,14 @@ var Text = function(parentEl) { return self.$tabStrings[tabSize]; } 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"; + var classToUse = self.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk"; var space = self.showInvisibles ? self.SPACE_CHAR : ""; screenColumn += 1; return "" + space + ""; } else if (b) { - return "" + self.SPACE_CHAR + ""; + return "" + self.SPACE_CHAR + ""; } else { screenColumn += 1; return "", + "", row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "" ); From a4b27cbc3a8bcf60dbf8f406ba31ce205870643a Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Fri, 14 Mar 2014 22:26:05 -0700 Subject: [PATCH 2/4] Resolve some CI failures. --- lib/ace/layer/text_test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ace/layer/text_test.js b/lib/ace/layer/text_test.js index a14a37e6..1aa1cae5 100644 --- a/lib/ace/layer/text_test.js +++ b/lib/ace/layer/text_test.js @@ -81,14 +81,14 @@ module.exports = { this.textLayer.$renderLine(stringBuilder, 0, true); assert.equal( stringBuilder.join(""), - "" + this.textLayer.SPACE_CHAR + "" - + "\xB6" + "" + this.textLayer.SPACE_CHAR + "" + + "\xB6" ); }, - - "test rendering of indent guides" : function() { + + "test rendering of indent guides" : function() { var textLayer = this.textLayer - var EOL = "" + textLayer.EOL_CHAR + ""; + var EOL = "" + textLayer.EOL_CHAR + ""; var SPACE = function(i) {return Array(i+1).join("\xa0")} var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)} var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)} From 6594a3fe5511fd06e27074697a92bf7d4c7bb525 Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Fri, 14 Mar 2014 22:32:31 -0700 Subject: [PATCH 3/4] Fix more CI failures. --- lib/ace/layer/text.js | 4 ++-- lib/ace/layer/text_test.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 0952577e..8955ddc3 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -146,8 +146,8 @@ var Text = function(parentEl) { var tabContent = spaceContent; } - this.$tabStrings[" "] = "" + spaceContent + ""; - this.$tabStrings["\t"] = "" + tabContent + ""; + this.$tabStrings[" "] = "" + spaceContent + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; } }; diff --git a/lib/ace/layer/text_test.js b/lib/ace/layer/text_test.js index 1aa1cae5..57601207 100644 --- a/lib/ace/layer/text_test.js +++ b/lib/ace/layer/text_test.js @@ -108,13 +108,13 @@ module.exports = { ]); this.textLayer.setShowInvisibles(true); testRender([ - "" + DOT(4) + "" + DOT(2) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL, + "" + DOT(4) + "" + DOT(2) + "" + EOL, + "" + TAB(4) + "" + TAB(4) + "f" + EOL, ]); this.textLayer.setDisplayIndentGuides(false); testRender([ - "" + DOT(6) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL + "" + DOT(6) + "" + EOL, + "" + TAB(4) + "" + TAB(4) + "f" + EOL ]); } }; From 5705c067fe052a776aca7bcccdca0ac13c32c9fd Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Fri, 14 Mar 2014 22:40:00 -0700 Subject: [PATCH 4/4] This should just about fix that. --- lib/ace/layer/text.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 8955ddc3..140700aa 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -137,8 +137,12 @@ var Text = function(parentEl) { if (this.displayIndentGuides) { this.$indentGuideRe = /\s\S| \t|\t |\s$/; var className = "ace_indent-guide"; + var spaceClass = ""; + var tabClass = ""; if (this.showInvisibles) { className += " ace_invisible"; + spaceClass = " ace_invisible_space"; + tabClass = " ace_invisible_tab"; var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1); } else{ @@ -146,8 +150,8 @@ var Text = function(parentEl) { var tabContent = spaceContent; } - this.$tabStrings[" "] = "" + spaceContent + ""; - this.$tabStrings["\t"] = "" + tabContent + ""; + this.$tabStrings[" "] = "" + spaceContent + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; } };