minor tab handling changes

This commit is contained in:
Fabian Jakobs 2010-04-23 10:51:08 +02:00
commit 6fa8ca3f64
2 changed files with 4 additions and 4 deletions

View file

@ -40,8 +40,9 @@ ace.Document = function(text, mode) {
this.getTabString = function() { this.getTabString = function() {
if (this.getUseSoftTabs()) { if (this.getUseSoftTabs()) {
return new Array(this.getTabSize()+1).join(" "); return new Array(this.getTabSize()+1).join(" ");
} } else {
return "\t"; return "\t";
}
}; };
this.$useSoftTabs = false; this.$useSoftTabs = false;

View file

@ -280,9 +280,8 @@ ace.Editor = function(renderer, doc) {
this.onTextInput = function(text) { this.onTextInput = function(text) {
var cursor = this.getCursorPosition(); var cursor = this.getCursorPosition();
if (this.doc.getUseSoftTabs()) { text = text.replace("\t", this.doc.getTabString());
text = text.replace(/\t/g, this.doc.getTabString()); console.log(this.doc.getTabString().length);
}
if (!this.selection.isEmpty()) { if (!this.selection.isEmpty()) {
var end = this.doc.replace(this.getSelectionRange(), text); var end = this.doc.replace(this.getSelectionRange(), text);