From 539aa4669c7008a1788ab71f35300f0bc58e509b Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 23 Apr 2010 15:22:19 +0200 Subject: [PATCH] tweak "show invisibles" --- src/layer/Text.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/layer/Text.js b/src/layer/Text.js index 7fbd8c35..a831a2e8 100644 --- a/src/layer/Text.js +++ b/src/layer/Text.js @@ -10,9 +10,11 @@ ace.layer.Text = function(parentEl) { (function() { -// this.ENTER_CHAR = "¶"; - this.ENTER_CHAR = "¬"; - this.TAB_CHAR = "‣"; +// this.EOF_CHAR = "¶"; + this.EOF_CHAR = "¶"; + this.EOL_CHAR = "¬"; +// this.TAB_CHAR = "‣"; + this.TAB_CHAR = "→"; this.setTokenizer = function(tokenizer) { this.tokenizer = tokenizer; @@ -59,7 +61,12 @@ ace.layer.Text = function(parentEl) { this.$computeTabString = function() { var tabSize = this.doc.getTabSize(); if (this.$showInvisibles) { - this.$tabString = ""; + var halfTab = (tabSize) / 2; + this.$tabString = ""; } else { this.$tabString = new Array(tabSize+1).join(" "); } @@ -103,7 +110,7 @@ ace.layer.Text = function(parentEl) { var output = token.value .replace(/&/g, "&") .replace(/" + this.ENTER_CHAR + ""); + if (this.$showInvisibles) { + if (row !== this.doc.getLength() - 1) { + stringBuilder.push(""); + } else { + stringBuilder.push(""); + } + } }; }).call(ace.layer.Text.prototype); \ No newline at end of file