update package

This commit is contained in:
Fabian Jakobs 2011-02-24 15:44:25 +01:00
commit 6a23853fb8
6 changed files with 42 additions and 42 deletions

View file

@ -4160,6 +4160,7 @@ var Editor =function(renderer, session) {
} }
this.setSession = function(session) { this.setSession = function(session) {
if (!session) debugger
if (this.session == session) return; if (this.session == session) return;
if (this.session) { if (this.session) {
@ -6677,7 +6678,7 @@ exports.bindings = {
"findnext": "Command-G", "findnext": "Command-G",
"findprevious": "Command-Shift-G", "findprevious": "Command-Shift-G",
"find": "Command-F", "find": "Command-F",
"replace": "Command-R", "replace": "Alt-Command-R",
"undo": "Command-Z", "undo": "Command-Z",
"redo": "Command-Shift-Z|Command-Y", "redo": "Command-Shift-Z|Command-Y",
"overwrite": "Insert", "overwrite": "Insert",
@ -6773,7 +6774,7 @@ exports.bindings = {
"findnext": "Ctrl-K", "findnext": "Ctrl-K",
"findprevious": "Ctrl-Shift-K", "findprevious": "Ctrl-Shift-K",
"find": "Ctrl-F", "find": "Ctrl-F",
"replace": "Ctrl-R", "replace": "Alt-Ctrl-R",
"undo": "Ctrl-Z", "undo": "Ctrl-Z",
"redo": "Ctrl-Shift-Z|Ctrl-Y", "redo": "Ctrl-Shift-Z|Ctrl-Y",
"overwrite": "Insert", "overwrite": "Insert",
@ -9208,14 +9209,15 @@ var Tokenizer = function(rules) {
this.regExps = {}; this.regExps = {};
for ( var key in this.rules) { for ( var key in this.rules) {
var state = this.rules[key]; var rule = this.rules[key];
var state = rule;
var ruleRegExps = []; var ruleRegExps = [];
for ( var i = 0; i < state.length; i++) { for ( var i = 0; i < state.length; i++)
ruleRegExps.push(state[i].regex); ruleRegExps.push(state[i].regex);
};
this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g"); this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", "g");
} }
}; };
@ -9242,19 +9244,19 @@ var Tokenizer = function(rules) {
for ( var i = 0; i < state.length; i++) { for ( var i = 0; i < state.length; i++) {
if (match[i + 1]) { if (match[i + 1]) {
if (typeof state[i].token == "function") { var rule = state[i];
type = state[i].token(match[0]);
} if (typeof rule.token == "function")
else { type = rule.token(match[0]);
type = state[i].token; else
} type = rule.token;
if (state[i].next && state[i].next !== currentState) { if (rule.next && rule.next !== currentState) {
currentState = state[i].next; currentState = rule.next;
var state = this.rules[currentState]; state = this.rules[currentState];
var lastIndex = re.lastIndex; lastIndex = re.lastIndex;
var re = this.regExps[currentState]; re = this.regExps[currentState];
re.lastIndex = lastIndex; re.lastIndex = lastIndex;
} }
break; break;
@ -9263,9 +9265,9 @@ var Tokenizer = function(rules) {
if (token.type !== type) { if (token.type !== type) {
if (token.type) { if (token.type)
tokens.push(token); tokens.push(token);
}
token = { token = {
type: type, type: type,
value: value value: value
@ -9274,16 +9276,14 @@ var Tokenizer = function(rules) {
token.value += value; token.value += value;
} }
if (lastIndex == line.length) { if (lastIndex == line.length)
break; break;
}
lastIndex = re.lastIndex; lastIndex = re.lastIndex;
}; };
if (token.type) { if (token.type)
tokens.push(token); tokens.push(token);
}
return { return {
tokens : tokens, tokens : tokens,
@ -12008,27 +12008,27 @@ var Text = function(parentEl) {
this.$measureSizes = function() { this.$measureSizes = function() {
var n = 1000; var n = 1000;
if (!this.$measureNode) { if (!this.$measureNode) {
var measureNode = this.$measureNode = dom.createElement("div"); var measureNode = this.$measureNode = dom.createElement("div");
var style = measureNode.style; var style = measureNode.style;
style.width = style.height = "auto"; style.width = style.height = "auto";
style.left = style.top = (-n * 40) + "px"; style.left = style.top = (-n * 40) + "px";
style.visibility = "hidden"; style.visibility = "hidden";
style.position = "absolute"; style.position = "absolute";
style.overflow = "visible"; style.overflow = "visible";
style.whiteSpace = "nowrap"; style.whiteSpace = "nowrap";
// in FF 3.6 monospace fonts can have a fixed sub pixel width. // in FF 3.6 monospace fonts can have a fixed sub pixel width.
// that's why we have to measure many characters // that's why we have to measure many characters
// Note: characterWidth can be a float! // Note: characterWidth can be a float!
measureNode.innerHTML = lang.stringRepeat("Xy", n); measureNode.innerHTML = lang.stringRepeat("Xy", n);
var container = this.element.parentNode; var container = this.element.parentNode;
while (!dom.hasCssClass(container, "ace_editor")) while (!dom.hasCssClass(container, "ace_editor"))
container = container.parentNode; container = container.parentNode;
container.appendChild(measureNode); container.appendChild(measureNode);
} }
var style = this.$measureNode.style; var style = this.$measureNode.style;
@ -12146,7 +12146,7 @@ var Text = function(parentEl) {
var html = []; var html = [];
if (tokens.length > row-firstRow) if (tokens.length > row-firstRow)
this.$renderLine(html, row, tokens[row-firstRow].tokens); this.$renderLine(html, row, tokens[row-firstRow].tokens);
// don't use setInnerHtml since we are working with an empty DIV // don't use setInnerHtml since we are working with an empty DIV
lineEl.innerHTML = html.join(""); lineEl.innerHTML = html.join("");
fragment.appendChild(lineEl); fragment.appendChild(lineEl);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long