diff --git a/src/Document.js b/src/Document.js index b7e98076..6192799f 100644 --- a/src/Document.js +++ b/src/Document.js @@ -40,8 +40,9 @@ ace.Document = function(text, mode) { this.getTabString = function() { if (this.getUseSoftTabs()) { return new Array(this.getTabSize()+1).join(" "); + } else { + return "\t"; } - return "\t"; }; this.$useSoftTabs = false; diff --git a/src/Editor.js b/src/Editor.js index 16524e4e..9f493b20 100644 --- a/src/Editor.js +++ b/src/Editor.js @@ -280,9 +280,8 @@ ace.Editor = function(renderer, doc) { this.onTextInput = function(text) { var cursor = this.getCursorPosition(); - if (this.doc.getUseSoftTabs()) { - text = text.replace(/\t/g, this.doc.getTabString()); - } + text = text.replace("\t", this.doc.getTabString()); + console.log(this.doc.getTabString().length); if (!this.selection.isEmpty()) { var end = this.doc.replace(this.getSelectionRange(), text);