tabs to spaces
This commit is contained in:
parent
37f5548289
commit
b99710cd9e
2 changed files with 31 additions and 31 deletions
|
|
@ -230,7 +230,7 @@ var Editor =function(renderer, session) {
|
|||
this.unsetStyle = function(style) {
|
||||
this.renderer.unsetStyle(style);
|
||||
};
|
||||
|
||||
|
||||
this.setFontSize = function(size) {
|
||||
this.container.style.fontSize = size;
|
||||
};
|
||||
|
|
@ -269,7 +269,7 @@ var Editor =function(renderer, session) {
|
|||
});
|
||||
this.textInput.focus();
|
||||
};
|
||||
|
||||
|
||||
this.isFocused = function() {
|
||||
return this.textInput.isFocused();
|
||||
};
|
||||
|
|
@ -407,7 +407,7 @@ var Editor =function(renderer, session) {
|
|||
var text = "";
|
||||
if (!this.selection.isEmpty())
|
||||
text = this.session.getTextRange(this.getSelectionRange());
|
||||
|
||||
|
||||
this._emit("copy", text);
|
||||
return text;
|
||||
};
|
||||
|
|
@ -523,7 +523,7 @@ var Editor =function(renderer, session) {
|
|||
this.onTextInput = function(text, notPasted) {
|
||||
if (!notPasted)
|
||||
this._emit("paste", text);
|
||||
|
||||
|
||||
// In case the text was not pasted and we got only one character, then
|
||||
// handel it as a command key stroke.
|
||||
if (notPasted && text.length == 1) {
|
||||
|
|
@ -661,11 +661,11 @@ var Editor =function(renderer, session) {
|
|||
return;
|
||||
|
||||
if (this.selection.isEmpty()){
|
||||
if(dir == "left")
|
||||
this.selection.selectLeft();
|
||||
else
|
||||
this.selection.selectRight();
|
||||
}
|
||||
if(dir == "left")
|
||||
this.selection.selectLeft();
|
||||
else
|
||||
this.selection.selectRight();
|
||||
}
|
||||
|
||||
var range = this.getSelectionRange();
|
||||
if (this.getBehavioursEnabled()) {
|
||||
|
|
@ -673,7 +673,7 @@ var Editor =function(renderer, session) {
|
|||
var state = session.getState(range.start.row);
|
||||
var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);
|
||||
if (new_range === false)
|
||||
return;
|
||||
return;
|
||||
if (new_range)
|
||||
range = new_range;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,9 +104,9 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
|
||||
this.$normalizePath = function(path) {
|
||||
if (!path.match(/^\w+:/)) {
|
||||
path = location.protocol + "//" + location.host
|
||||
path = location.protocol + "//" + location.host
|
||||
// paths starting with a slash are relative to the root (host)
|
||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||
+ "/" + path.replace(/^[\/]+/, "");
|
||||
}
|
||||
return path;
|
||||
|
|
@ -115,7 +115,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
this.$guessBasePath = function() {
|
||||
if (require.aceBaseUrl)
|
||||
return require.aceBaseUrl;
|
||||
|
||||
|
||||
var scripts = document.getElementsByTagName("script");
|
||||
for (var i=0; i<scripts.length; i++) {
|
||||
var script = scripts[i];
|
||||
|
|
@ -123,7 +123,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
var base = script.getAttribute("data-ace-base");
|
||||
if (base)
|
||||
return base.replace(/\/*$/, "/");
|
||||
|
||||
|
||||
var src = script.src || script.getAttribute("src");
|
||||
if (!src) {
|
||||
continue;
|
||||
|
|
@ -139,8 +139,8 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
this._dispatchEvent("terminate", {});
|
||||
this.$worker.terminate();
|
||||
this.$worker = null;
|
||||
this.$doc.removeEventListener("change", this.changeListener);
|
||||
this.$doc = null;
|
||||
this.$doc.removeEventListener("change", this.changeListener);
|
||||
this.$doc = null;
|
||||
};
|
||||
|
||||
this.send = function(cmd, args) {
|
||||
|
|
@ -164,23 +164,23 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, module, classname) {
|
|||
}
|
||||
catch(ex) {}
|
||||
};
|
||||
|
||||
this.attachToDocument = function(doc) {
|
||||
if(this.$doc)
|
||||
this.terminate();
|
||||
|
||||
this.$doc = doc;
|
||||
this.call("setValue", [doc.getValue()]);
|
||||
this.attachToDocument = function(doc) {
|
||||
if(this.$doc)
|
||||
this.terminate();
|
||||
|
||||
this.$doc = doc;
|
||||
this.call("setValue", [doc.getValue()]);
|
||||
doc.on("change", this.changeListener);
|
||||
};
|
||||
|
||||
this.changeListener = function(e) {
|
||||
e.range = {
|
||||
start: e.data.range.start,
|
||||
end: e.data.range.end
|
||||
};
|
||||
this.emit("change", e);
|
||||
};
|
||||
};
|
||||
|
||||
this.changeListener = function(e) {
|
||||
e.range = {
|
||||
start: e.data.range.start,
|
||||
end: e.data.range.end
|
||||
};
|
||||
this.emit("change", e);
|
||||
};
|
||||
|
||||
}).call(WorkerClient.prototype);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue