update build
This commit is contained in:
parent
0a3111c8fb
commit
c831fb5276
11 changed files with 298 additions and 244 deletions
|
|
@ -4103,7 +4103,7 @@ var Editor =function(renderer, session) {
|
|||
|
||||
this.$selectionMarker = null;
|
||||
this.$highlightLineMarker = null;
|
||||
this.$blockScrolling = false;
|
||||
this.$blockScrolling = 0;
|
||||
|
||||
this.$search = new Search().set({
|
||||
wrap: true
|
||||
|
|
@ -4315,7 +4315,7 @@ var Editor =function(renderer, session) {
|
|||
this.onCursorChange = function(e) {
|
||||
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
|
||||
|
||||
if (!this.$blockScrolling && (!e || !e.blockScrolling)) {
|
||||
if (!this.$blockScrolling) {
|
||||
this.renderer.scrollCursorIntoView();
|
||||
}
|
||||
|
||||
|
|
@ -4405,7 +4405,7 @@ var Editor =function(renderer, session) {
|
|||
return;
|
||||
|
||||
if (!this.selection.isEmpty()) {
|
||||
this.moveCursorToPosition(this.session.remove(this.getSelectionRange()));
|
||||
this.session.remove(this.getSelectionRange())
|
||||
this.clearSelection();
|
||||
}
|
||||
};
|
||||
|
|
@ -4435,14 +4435,6 @@ var Editor =function(renderer, session) {
|
|||
var lineIndent = this.mode.getNextLineIndent(lineState, line.slice(0, cursor.column), this.session.getTabString());
|
||||
var end = this.session.insert(cursor, text);
|
||||
|
||||
/* TODO: This shortcut is somehow broken
|
||||
if (!shouldOutdent && line != this.session.getLine(row) && text != "\n") {
|
||||
this.moveCursorToPosition(end);
|
||||
this.renderer.scrollCursorIntoView();
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
var lineState = this.bgTokenizer.getState(cursor.row);
|
||||
// multi line insert
|
||||
if (cursor.row !== end.row) {
|
||||
|
|
@ -4475,15 +4467,12 @@ var Editor =function(renderer, session) {
|
|||
outdent -= 1;
|
||||
this.session.replace(new Range(row, 0, row, line.length), line.substr(i));
|
||||
}
|
||||
end.column += this.session.indentRows(cursor.row + 1, end.row, lineIndent);
|
||||
this.session.indentRows(cursor.row + 1, end.row, lineIndent);
|
||||
} else {
|
||||
if (shouldOutdent) {
|
||||
end.column += this.mode.autoOutdent(lineState, this.session, cursor.row);
|
||||
this.mode.autoOutdent(lineState, this.session, cursor.row);
|
||||
}
|
||||
}
|
||||
|
||||
this.moveCursorToPosition(end);
|
||||
this.renderer.scrollCursorIntoView();
|
||||
}
|
||||
|
||||
this.onTextInput = function(text) {
|
||||
|
|
@ -4500,9 +4489,9 @@ var Editor =function(renderer, session) {
|
|||
|
||||
this.$overwrite = overwrite;
|
||||
|
||||
this.$blockScrolling = true;
|
||||
this.$blockScrolling += 1;
|
||||
this.onCursorChange();
|
||||
this.$blockScrolling = false;
|
||||
this.$blockScrolling -= 1;
|
||||
|
||||
this._dispatchEvent("changeOverwrite", {data: overwrite});
|
||||
};
|
||||
|
|
@ -4591,7 +4580,7 @@ var Editor =function(renderer, session) {
|
|||
if (this.selection.isEmpty()) {
|
||||
this.selection.selectRight();
|
||||
}
|
||||
this.moveCursorToPosition(this.session.remove(this.getSelectionRange()));
|
||||
this.session.remove(this.getSelectionRange())
|
||||
this.clearSelection();
|
||||
};
|
||||
|
||||
|
|
@ -4602,7 +4591,7 @@ var Editor =function(renderer, session) {
|
|||
if (this.selection.isEmpty())
|
||||
this.selection.selectLeft();
|
||||
|
||||
this.moveCursorToPosition(this.session.remove(this.getSelectionRange()));
|
||||
this.session.remove(this.getSelectionRange());
|
||||
this.clearSelection();
|
||||
};
|
||||
|
||||
|
|
@ -4615,9 +4604,7 @@ var Editor =function(renderer, session) {
|
|||
|
||||
if (range.start.row < range.end.row || range.start.column < range.end.column) {
|
||||
var rows = this.$getSelectedRows();
|
||||
var count = session.indentRows(rows.first, rows.last, "\t");
|
||||
|
||||
this.selection.shiftSelection(count);
|
||||
session.indentRows(rows.first, rows.last, "\t");
|
||||
} else {
|
||||
var indentString;
|
||||
|
||||
|
|
@ -4639,9 +4626,7 @@ var Editor =function(renderer, session) {
|
|||
return;
|
||||
|
||||
var selection = this.session.getSelection();
|
||||
var range = this.session.outdentRows(selection.getRange());
|
||||
|
||||
selection.setSelectionRange(range, selection.isBackwards());
|
||||
this.session.outdentRows(selection.getRange());
|
||||
};
|
||||
|
||||
this.toggleCommentLines = function() {
|
||||
|
|
@ -4650,8 +4635,7 @@ var Editor =function(renderer, session) {
|
|||
|
||||
var state = this.bgTokenizer.getState(this.getCursorPosition().row);
|
||||
var rows = this.$getSelectedRows()
|
||||
var addedColumns = this.mode.toggleCommentLines(state, this.session, rows.first, rows.last);
|
||||
this.selection.shiftSelection(addedColumns);
|
||||
this.mode.toggleCommentLines(state, this.session, rows.first, rows.last);
|
||||
};
|
||||
|
||||
this.removeLines = function() {
|
||||
|
|
@ -4659,10 +4643,7 @@ var Editor =function(renderer, session) {
|
|||
return;
|
||||
|
||||
var rows = this.$getSelectedRows();
|
||||
this.selection.setSelectionAnchor(rows.last+1, 0);
|
||||
this.selection.selectTo(rows.first, 0);
|
||||
|
||||
this.session.remove(this.getSelectionRange());
|
||||
this.session.remove(new Range(rows.first, 0, rows.last+1, 0));
|
||||
this.clearSelection();
|
||||
};
|
||||
|
||||
|
|
@ -4727,7 +4708,6 @@ var Editor =function(renderer, session) {
|
|||
|
||||
this.onCompositionStart = function(text) {
|
||||
this.renderer.showComposition(this.getCursorPosition());
|
||||
//this.onTextInput(text);
|
||||
};
|
||||
|
||||
this.onCompositionUpdate = function(text) {
|
||||
|
|
@ -4736,7 +4716,6 @@ var Editor =function(renderer, session) {
|
|||
|
||||
this.onCompositionEnd = function() {
|
||||
this.renderer.hideComposition();
|
||||
//this.removeLeft();
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -4829,6 +4808,13 @@ var Editor =function(renderer, session) {
|
|||
return this.selection.getRange();
|
||||
};
|
||||
|
||||
|
||||
this.selectAll = function() {
|
||||
this.$blockScrolling += 1;
|
||||
this.selection.selectAll();
|
||||
this.$blockScrolling -= 1;
|
||||
};
|
||||
|
||||
this.clearSelection = function() {
|
||||
this.selection.clearSelection();
|
||||
};
|
||||
|
|
@ -4845,9 +4831,9 @@ var Editor =function(renderer, session) {
|
|||
this.gotoLine = function(lineNumber, row) {
|
||||
this.selection.clearSelection();
|
||||
|
||||
this.$blockScrolling = true;
|
||||
this.$blockScrolling += 1;
|
||||
this.moveCursorTo(lineNumber-1, row || 0);
|
||||
this.$blockScrolling = false;
|
||||
this.$blockScrolling -= 1;
|
||||
|
||||
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
||||
this.scrollToRow(lineNumber - 1 - Math.floor(this.getVisibleRowCount() / 2));
|
||||
|
|
@ -6524,7 +6510,7 @@ canon.addCommand({
|
|||
|
||||
canon.addCommand({
|
||||
name: "selectall",
|
||||
exec: function(env, args, request) { env.editor.getSelection().selectAll(); }
|
||||
exec: function(env, args, request) { env.editor.selectAll(); }
|
||||
});
|
||||
canon.addCommand({
|
||||
name: "removeline",
|
||||
|
|
@ -6786,7 +6772,6 @@ var NO_CHANGE_DELTAS = {};
|
|||
|
||||
var EditSession = function(text, mode) {
|
||||
this.$modified = true;
|
||||
this.selection = new Selection(this);
|
||||
this.$breakpoints = [];
|
||||
this.$wrapData = [];
|
||||
this.listeners = [];
|
||||
|
|
@ -6797,6 +6782,7 @@ var EditSession = function(text, mode) {
|
|||
this.setDocument(new Document(text));
|
||||
}
|
||||
|
||||
this.selection = new Selection(this);
|
||||
if (mode)
|
||||
this.setMode(mode);
|
||||
};
|
||||
|
|
@ -7220,52 +7206,10 @@ var EditSession = function(text, mode) {
|
|||
return this.doc.insert(position, text);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param rows Array[Integer] sorted list of rows
|
||||
*/
|
||||
this.multiRowInsert = function(rows, column, text) {
|
||||
for (var i=rows.length-1; i>=0; i--) {
|
||||
var row = rows[i];
|
||||
if (row >= this.doc.getLength())
|
||||
continue;
|
||||
|
||||
var diff = column - this.doc.getLine(row).length;
|
||||
if ( diff > 0) {
|
||||
var padded = lang.stringRepeat(" ", diff) + text;
|
||||
var offset = -diff;
|
||||
}
|
||||
else {
|
||||
padded = text;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
var end = this.insert({row: row, column: column+offset}, padded);
|
||||
}
|
||||
|
||||
return {
|
||||
rows: end ? end.row - rows[0] : 0,
|
||||
columns: end ? end.column - column : 0
|
||||
};
|
||||
};
|
||||
|
||||
this.remove = function(range) {
|
||||
return this.doc.remove(range);
|
||||
};
|
||||
|
||||
this.multiRowRemove = function(rows, range) {
|
||||
if (range.start.row !== rows[0])
|
||||
throw new TypeError("range must start in the first row!");
|
||||
|
||||
var height = range.end.row - rows[0];
|
||||
for (var i=rows.length-1; i>=0; i--) {
|
||||
var row = rows[i];
|
||||
if (row >= this.doc.getLength())
|
||||
continue;
|
||||
|
||||
var end = this.remove(new Range(row, range.start.column, row+height, range.end.column));
|
||||
}
|
||||
};
|
||||
|
||||
this.undoChanges = function(deltas) {
|
||||
if (!deltas.length)
|
||||
return;
|
||||
|
|
@ -7313,7 +7257,6 @@ var EditSession = function(text, mode) {
|
|||
for (var row=startRow; row<=endRow; row++) {
|
||||
this.insert({row: row, column:0}, indentString);
|
||||
}
|
||||
return indentString.length;
|
||||
};
|
||||
|
||||
this.outdentRows = function (range) {
|
||||
|
|
@ -7336,13 +7279,8 @@ var EditSession = function(text, mode) {
|
|||
deleteRange.start.column = 0;
|
||||
deleteRange.end.column = j;
|
||||
}
|
||||
if (i == range.start.row)
|
||||
range.start.column -= deleteRange.end.column - deleteRange.start.column;
|
||||
if (i == range.end.row)
|
||||
range.end.column -= deleteRange.end.column - deleteRange.start.column;
|
||||
this.remove(deleteRange);
|
||||
}
|
||||
return range;
|
||||
};
|
||||
|
||||
this.moveLinesUp = function(firstRow, lastRow) {
|
||||
|
|
@ -7980,15 +7918,27 @@ var oop = require("pilot/oop");
|
|||
var lang = require("pilot/lang");
|
||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
var Range = require("ace/range").Range;
|
||||
var Anchor = require("ace/anchor").Anchor;
|
||||
|
||||
var Selection = function(doc) {
|
||||
this.doc = doc;
|
||||
var Selection = function(session) {
|
||||
this.session = session;
|
||||
this.doc = session.getDocument();
|
||||
|
||||
this.clearSelection();
|
||||
this.selectionLead = {
|
||||
row: 0,
|
||||
column: 0
|
||||
};
|
||||
this.selectionLead = new Anchor(this.doc, 0, 0);
|
||||
this.selectionAnchor = new Anchor(this.doc, 0, 0);
|
||||
|
||||
var _self = this;
|
||||
this.selectionLead.on("change", function() {
|
||||
_self._dispatchEvent("changeCursor");
|
||||
if (!_self.$isEmpty)
|
||||
_self._dispatchEvent("changeSelection");
|
||||
});
|
||||
|
||||
this.selectionAnchor.on("change", function() {
|
||||
if (!_self.$isEmpty)
|
||||
_self._dispatchEvent("changeSelection");
|
||||
});
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
|
@ -7996,9 +7946,10 @@ var Selection = function(doc) {
|
|||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.isEmpty = function() {
|
||||
return (!this.selectionAnchor ||
|
||||
(this.selectionAnchor.row == this.selectionLead.row &&
|
||||
this.selectionAnchor.column == this.selectionLead.column));
|
||||
return (this.$isEmpty || (
|
||||
this.selectionAnchor.row == this.selectionLead.row &&
|
||||
this.selectionAnchor.column == this.selectionLead.column
|
||||
));
|
||||
};
|
||||
|
||||
this.isMultiLine = function() {
|
||||
|
|
@ -8010,37 +7961,31 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.getCursor = function() {
|
||||
return this.selectionLead;
|
||||
return this.selectionLead.getPosition();
|
||||
};
|
||||
|
||||
this.setSelectionAnchor = function(row, column) {
|
||||
var anchor = this.$clipPositionToDocument(row, column);
|
||||
this.selectionAnchor.setPosition(row, column);
|
||||
|
||||
if (!this.selectionAnchor) {
|
||||
this.selectionAnchor = anchor;
|
||||
this._dispatchEvent("changeSelection", {});
|
||||
if (this.$isEmpty) {
|
||||
this.$isEmpty = false;
|
||||
this._dispatchEvent("changeSelection");
|
||||
}
|
||||
else if (this.selectionAnchor.row !== anchor.row || this.selectionAnchor.column !== anchor.column) {
|
||||
this.selectionAnchor = anchor;
|
||||
this._dispatchEvent("changeSelection", {});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.getSelectionAnchor = function() {
|
||||
if (this.selectionAnchor) {
|
||||
return this.$clone(this.selectionAnchor);
|
||||
} else {
|
||||
return this.$clone(this.selectionLead);
|
||||
}
|
||||
if (this.$isEmpty)
|
||||
return this.getSelectionLead()
|
||||
else
|
||||
return this.selectionAnchor.getPosition();
|
||||
};
|
||||
|
||||
this.getSelectionLead = function() {
|
||||
return this.$clone(this.selectionLead);
|
||||
return this.selectionLead.getPosition();
|
||||
};
|
||||
|
||||
this.shiftSelection = function(columns) {
|
||||
if (this.isEmpty()) {
|
||||
if (this.$isEmpty) {
|
||||
this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns);
|
||||
return;
|
||||
};
|
||||
|
|
@ -8061,15 +8006,18 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.isBackwards = function() {
|
||||
var anchor = this.selectionAnchor || this.selectionLead;
|
||||
var anchor = this.selectionAnchor;
|
||||
var lead = this.selectionLead;
|
||||
return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column));
|
||||
};
|
||||
|
||||
this.getRange = function() {
|
||||
var anchor = this.selectionAnchor || this.selectionLead;
|
||||
var anchor = this.selectionAnchor;
|
||||
var lead = this.selectionLead;
|
||||
|
||||
if (this.isEmpty())
|
||||
return Range.fromPoints(lead, lead);
|
||||
|
||||
if (this.isBackwards()) {
|
||||
return Range.fromPoints(lead, anchor);
|
||||
}
|
||||
|
|
@ -8079,26 +8027,16 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.clearSelection = function() {
|
||||
if (this.selectionAnchor) {
|
||||
this.selectionAnchor = null;
|
||||
this._dispatchEvent("changeSelection", {});
|
||||
if (!this.$isEmpty) {
|
||||
this.$isEmpty = true;
|
||||
this._dispatchEvent("changeSelection");
|
||||
}
|
||||
};
|
||||
|
||||
this.selectAll = function() {
|
||||
var lastRow = this.doc.getLength() - 1;
|
||||
this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length);
|
||||
|
||||
if (!this.selectionAnchor) {
|
||||
this.selectionAnchor = this.$clone(this.selectionLead);
|
||||
}
|
||||
|
||||
var cursor = {row:0, column:0};
|
||||
// only dispatch change if the cursor actually changed
|
||||
if (cursor.row !== this.selectionLead.row || cursor.column !== this.selectionLead.column) {
|
||||
this.selectionLead = cursor;
|
||||
this._dispatchEvent("changeSelection", {blockScrolling: true});
|
||||
}
|
||||
this.moveCursorTo(0, 0);
|
||||
};
|
||||
|
||||
this.setSelectionRange = function(range, reverse) {
|
||||
|
|
@ -8115,27 +8053,16 @@ var Selection = function(doc) {
|
|||
this.$updateDesiredColumn = function() {
|
||||
var cursor = this.getCursor();
|
||||
if (cursor) {
|
||||
this.$desiredColumn = this.doc.documentToScreenColumn(cursor.row, cursor.column);
|
||||
this.$desiredColumn = this.session.documentToScreenColumn(cursor.row, cursor.column);
|
||||
}
|
||||
};
|
||||
|
||||
this.$moveSelection = function(mover) {
|
||||
var changed = false;
|
||||
var lead = this.selectionLead;
|
||||
if (this.$isEmpty)
|
||||
this.setSelectionAnchor(lead.row, lead.column);
|
||||
|
||||
if (!this.selectionAnchor) {
|
||||
changed = true;
|
||||
this.selectionAnchor = this.$clone(this.selectionLead);
|
||||
}
|
||||
|
||||
var cursor = this.$clone(this.selectionLead);
|
||||
mover.call(this);
|
||||
|
||||
if (cursor.row !== this.selectionLead.row || cursor.column !== this.selectionLead.column) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
this._dispatchEvent("changeSelection", {});
|
||||
};
|
||||
|
||||
this.selectTo = function(row, column) {
|
||||
|
|
@ -8191,15 +8118,9 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.selectWord = function() {
|
||||
var cursor = this.selectionLead;
|
||||
var column = cursor.column;
|
||||
var range = this.doc.getWordRange(cursor.row, column);
|
||||
var cursor = this.getCursor();
|
||||
var range = this.session.getWordRange(cursor.row, cursor.column);
|
||||
this.setSelectionRange(range);
|
||||
|
||||
/*this.setSelectionAnchor(cursor.row, start);
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(cursor.row, end);
|
||||
});*/
|
||||
};
|
||||
|
||||
this.selectLine = function() {
|
||||
|
|
@ -8218,18 +8139,16 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.moveCursorLeft = function() {
|
||||
if (this.selectionLead.column == 0) {
|
||||
var cursor = this.selectionLead.getPosition();
|
||||
if (cursor.column == 0) {
|
||||
// cursor is a line (start
|
||||
if (this.selectionLead.row > 0) {
|
||||
this.moveCursorTo(this.selectionLead.row - 1, this.doc
|
||||
.getLine(this.selectionLead.row - 1).length);
|
||||
if (cursor.row > 0) {
|
||||
this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var doc = this.doc;
|
||||
var tabSize = doc.getTabSize();
|
||||
var cursor = this.selectionLead;
|
||||
if (doc.isTabStop(cursor) && doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize)
|
||||
var tabSize = this.session.getTabSize();
|
||||
if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize)
|
||||
this.moveCursorBy(0, -tabSize);
|
||||
else
|
||||
this.moveCursorBy(0, -1);
|
||||
|
|
@ -8243,10 +8162,9 @@ var Selection = function(doc) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
var doc = this.doc;
|
||||
var tabSize = doc.getTabSize();
|
||||
var tabSize = this.session.getTabSize();
|
||||
var cursor = this.selectionLead;
|
||||
if (doc.isTabStop(cursor) && doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize)
|
||||
if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize)
|
||||
this.moveCursorBy(0, tabSize);
|
||||
else
|
||||
this.moveCursorBy(0, 1);
|
||||
|
|
@ -8256,12 +8174,12 @@ var Selection = function(doc) {
|
|||
this.moveCursorLineStart = function() {
|
||||
var row = this.selectionLead.row;
|
||||
var column = this.selectionLead.column;
|
||||
var screenRow = this.doc.documentToScreenRow(row, column);
|
||||
var firstRowColumn = this.doc.getScreenFirstRowColumn(screenRow);
|
||||
var screenRow = this.session.documentToScreenRow(row, column);
|
||||
var firstRowColumn = this.session.getScreenFirstRowColumn(screenRow);
|
||||
var beforeCursor = this.doc.getLine(row).slice(firstRowColumn, column);
|
||||
var leadingSpace = beforeCursor.match(/^\s*/);
|
||||
if (leadingSpace[0].length == 0) {
|
||||
var lastRowColumn = this.doc.getDocumentLastRowColumn(row, column);
|
||||
var lastRowColumn = this.session.getDocumentLastRowColumn(row, column);
|
||||
leadingSpace = this.doc.getLine(row).
|
||||
substring(firstRowColumn, lastRowColumn).
|
||||
match(/^\s*/);
|
||||
|
|
@ -8274,9 +8192,8 @@ var Selection = function(doc) {
|
|||
};
|
||||
|
||||
this.moveCursorLineEnd = function() {
|
||||
var selLead = this.selectionLead;
|
||||
this.moveCursorTo(selLead.row,
|
||||
this.doc.getDocumentLastRowColumn(selLead.row, selLead.column));
|
||||
var lead = this.selectionLead;
|
||||
this.moveCursorTo(lead.row, this.session.getDocumentLastRowColumn(lead.row, lead.column));
|
||||
};
|
||||
|
||||
this.moveCursorFileEnd = function() {
|
||||
|
|
@ -8296,20 +8213,20 @@ var Selection = function(doc) {
|
|||
var rightOfCursor = line.substring(column);
|
||||
|
||||
var match;
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
this.session.nonTokenRe.lastIndex = 0;
|
||||
this.session.tokenRe.lastIndex = 0;
|
||||
|
||||
if (column == line.length) {
|
||||
this.moveCursorRight();
|
||||
return;
|
||||
}
|
||||
else if (match = this.doc.nonTokenRe.exec(rightOfCursor)) {
|
||||
column += this.doc.nonTokenRe.lastIndex;
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
else if (match = this.session.nonTokenRe.exec(rightOfCursor)) {
|
||||
column += this.session.nonTokenRe.lastIndex;
|
||||
this.session.nonTokenRe.lastIndex = 0;
|
||||
}
|
||||
else if (match = this.doc.tokenRe.exec(rightOfCursor)) {
|
||||
column += this.doc.tokenRe.lastIndex;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
else if (match = this.session.tokenRe.exec(rightOfCursor)) {
|
||||
column += this.session.tokenRe.lastIndex;
|
||||
this.session.tokenRe.lastIndex = 0;
|
||||
}
|
||||
|
||||
this.moveCursorTo(row, column);
|
||||
|
|
@ -8322,83 +8239,49 @@ var Selection = function(doc) {
|
|||
var leftOfCursor = lang.stringReverse(line.substring(0, column));
|
||||
|
||||
var match;
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
this.session.nonTokenRe.lastIndex = 0;
|
||||
this.session.tokenRe.lastIndex = 0;
|
||||
|
||||
if (column == 0) {
|
||||
this.moveCursorLeft();
|
||||
return;
|
||||
}
|
||||
else if (match = this.doc.nonTokenRe.exec(leftOfCursor)) {
|
||||
column -= this.doc.nonTokenRe.lastIndex;
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
else if (match = this.session.nonTokenRe.exec(leftOfCursor)) {
|
||||
column -= this.session.nonTokenRe.lastIndex;
|
||||
this.session.nonTokenRe.lastIndex = 0;
|
||||
}
|
||||
else if (match = this.doc.tokenRe.exec(leftOfCursor)) {
|
||||
column -= this.doc.tokenRe.lastIndex;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
else if (match = this.session.tokenRe.exec(leftOfCursor)) {
|
||||
column -= this.session.tokenRe.lastIndex;
|
||||
this.session.tokenRe.lastIndex = 0;
|
||||
}
|
||||
|
||||
this.moveCursorTo(row, column);
|
||||
};
|
||||
|
||||
this.moveCursorBy = function(rows, chars) {
|
||||
if (this.doc.getUseWrapMode()) {
|
||||
var screenPos = this.doc.documentToScreenPosition(
|
||||
this.selectionLead.row, this.selectionLead.column);
|
||||
var screenCol =
|
||||
(chars == 0 && this.$desiredColumn) || screenPos.column;
|
||||
|
||||
var docPos = this.doc.screenToDocumentPosition(
|
||||
screenPos.row + rows, screenCol);
|
||||
if (this.session.getUseWrapMode()) {
|
||||
var screenPos = this.session.documentToScreenPosition(
|
||||
this.selectionLead.row,
|
||||
this.selectionLead.column
|
||||
);
|
||||
var screenCol = (chars == 0 && this.$desiredColumn) || screenPos.column;
|
||||
var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenCol);
|
||||
|
||||
this.moveCursorTo(docPos.row, docPos.column + chars, chars == 0);
|
||||
} else {
|
||||
var docColumn =
|
||||
(chars == 0 && this.$desiredColumn) || this.selectionLead.column;
|
||||
this.moveCursorTo(
|
||||
this.selectionLead.row + rows, docColumn + chars, chars == 0);
|
||||
var docColumn = (chars == 0 && this.$desiredColumn) || this.selectionLead.column;
|
||||
this.moveCursorTo(this.selectionLead.row + rows, docColumn + chars, chars == 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.moveCursorToPosition = function(position) {
|
||||
this.moveCursorTo(position.row, position.column);
|
||||
};
|
||||
|
||||
this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) {
|
||||
var cursor = this.$clipPositionToDocument(row, column);
|
||||
|
||||
// only dispatch change if the cursor actually changed
|
||||
if (cursor.row !== this.selectionLead.row || cursor.column !== this.selectionLead.column) {
|
||||
this.selectionLead = cursor;
|
||||
!preventUpdateDesiredColumn && this.$updateDesiredColumn(column);
|
||||
this._dispatchEvent("changeCursor", { data: this.getCursor() });
|
||||
}
|
||||
};
|
||||
|
||||
this.$clipPositionToDocument = function(row, column) {
|
||||
var pos = {};
|
||||
|
||||
if (row >= this.doc.getLength()) {
|
||||
pos.row = Math.max(0, this.doc.getLength() - 1);
|
||||
pos.column = this.doc.getLine(pos.row).length;
|
||||
}
|
||||
else if (row < 0) {
|
||||
pos.row = 0;
|
||||
pos.column = 0;
|
||||
}
|
||||
else {
|
||||
pos.row = row;
|
||||
pos.column = Math.min(this.doc.getLine(pos.row).length,
|
||||
Math.max(0, column));
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
|
||||
this.$clone = function(pos) {
|
||||
return {
|
||||
row: pos.row,
|
||||
column: pos.column
|
||||
};
|
||||
this.selectionLead.setPosition(row, column);
|
||||
if (!preventUpdateDesiredColumn)
|
||||
this.$updateDesiredColumn(this.selectionLead.column);
|
||||
};
|
||||
|
||||
}).call(Selection.prototype);
|
||||
|
|
@ -8571,6 +8454,180 @@ Range.fromPoints = function(start, end) {
|
|||
};
|
||||
|
||||
exports.Range = Range;
|
||||
});
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Ajax.org Code Editor (ACE).
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ajax.org B.V.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define('ace/anchor', function(require, exports, module) {
|
||||
|
||||
var oop = require("pilot/oop");
|
||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
|
||||
/**
|
||||
* An Anchor is a floating pointer in the document. Whenever text is inserted or
|
||||
* deleted before the cursor, the position of the cursor is updated
|
||||
*/
|
||||
var Anchor = exports.Anchor = function(doc, row, column) {
|
||||
this.document = doc;
|
||||
|
||||
if (typeof column == "undefined")
|
||||
this.setPosition(row.row, row.column)
|
||||
else
|
||||
this.setPosition(row, column);
|
||||
|
||||
this.$onChange = this.onChange.bind(this);
|
||||
doc.on("change", this.$onChange);
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.getPosition = function() {
|
||||
return this.$clipPositionToDocument(this.row, this.column);
|
||||
};
|
||||
|
||||
this.getDocument = function() {
|
||||
return this.document;
|
||||
};
|
||||
|
||||
this.onChange = function(e) {
|
||||
var delta = e.data;
|
||||
var range = delta.range;
|
||||
|
||||
if (range.start.row == range.end.row && range.start.row != this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row > this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row == this.row && range.start.column > this.column)
|
||||
return;
|
||||
|
||||
var row = this.row;
|
||||
var column = this.column;
|
||||
|
||||
if (delta.action === "insertText") {
|
||||
if (range.start.row === row && range.start.column <= column) {
|
||||
if (range.start.row === range.end.row) {
|
||||
column += range.end.column - range.start.column;
|
||||
}
|
||||
else {
|
||||
column -= range.start.column;
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
}
|
||||
else if (range.start.row !== range.end.row && range.start.row < row) {
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
} else if (delta.action === "insertLines") {
|
||||
if (range.start.row <= row) {
|
||||
row += range.end.row - range.start.row;
|
||||
}
|
||||
}
|
||||
else if (delta.action == "removeText") {
|
||||
if (range.start.row == row && range.start.column < column) {
|
||||
if (range.end.column >= column)
|
||||
column = range.start.column;
|
||||
else
|
||||
column = Math.max(0, column - (range.end.column - range.start.column));
|
||||
|
||||
} else if (range.start.row !== range.end.row && range.start.row < row) {
|
||||
if (range.end.row == row) {
|
||||
column = Math.max(0, column - range.end.column) + range.start.column;
|
||||
}
|
||||
row -= (range.end.row - range.start.row);
|
||||
}
|
||||
else if (range.end.row == row) {
|
||||
row -= range.end.row - range.start.row;
|
||||
column = Math.max(0, column - range.end.column) + range.start.column;
|
||||
}
|
||||
} else if (delta.action == "removeLines") {
|
||||
if (range.start.row <= row) {
|
||||
if (range.end.row <= row)
|
||||
row -= range.end.row - range.start.row;
|
||||
else {
|
||||
row = range.start.row;
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setPosition(row, column);
|
||||
};
|
||||
|
||||
this.setPosition = function(row, column) {
|
||||
pos = this.$clipPositionToDocument(row, column);
|
||||
if (this.row == pos.row && this.column == pos.column)
|
||||
return;
|
||||
|
||||
this.row = pos.row;
|
||||
this.column = pos.column;
|
||||
this._dispatchEvent("change");
|
||||
};
|
||||
|
||||
this.detach = function() {
|
||||
this.document.removeEventListener("change", this.$onChange);
|
||||
};
|
||||
|
||||
this.$clipPositionToDocument = function(row, column) {
|
||||
var pos = {};
|
||||
|
||||
if (row >= this.document.getLength()) {
|
||||
pos.row = Math.max(0, this.document.getLength() - 1);
|
||||
pos.column = this.document.getLine(pos.row).length;
|
||||
}
|
||||
else if (row < 0) {
|
||||
pos.row = 0;
|
||||
pos.column = 0;
|
||||
}
|
||||
else {
|
||||
pos.row = row;
|
||||
pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
|
||||
}
|
||||
|
||||
if (column < 0)
|
||||
pos.column = 0;
|
||||
|
||||
return pos;
|
||||
};
|
||||
|
||||
}).call(Anchor.prototype);
|
||||
|
||||
});
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
|
@ -8625,7 +8682,6 @@ var Mode = function() {
|
|||
};
|
||||
|
||||
this.toggleCommentLines = function(state, doc, startRow, endRow) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
|
|
@ -9947,8 +10003,6 @@ var MatchingBraceOutdent = function() {};
|
|||
|
||||
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
||||
doc.replace(new Range(row, 0, row, column-1), indent);
|
||||
|
||||
return indent.length - (column-1);
|
||||
};
|
||||
|
||||
this.$getIndent = function(line) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
define("ace/mode/c_cpp",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/c_cpp_highlight_rules").c_cppHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/c_cpp_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;c_cppHighlightRules=function(){var a=new f,b=e.arrayToMap("and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|typeid|bitor|extern|protected|typename|bool|false|public|union|break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|friend|return|virtual|char|goto|short|void|class|if|signed|volatile|compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|switch|delete|new|template|do|not|this|for".split("|")),c=e.arrayToMap("NULL".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant",regex:"<[a-zA-Z0-9.]+>"},{token:"keyword",regex:"(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},{token:function(a){return a=="this"?"variable.language":b.hasOwnProperty(a)?"keyword":c.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(c_cppHighlightRules,g),b.c_cppHighlightRules=c_cppHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f})
|
||||
define("ace/mode/c_cpp",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/c_cpp_highlight_rules").c_cppHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)\/\//;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/c_cpp_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules,g=a("ace/mode/text_highlight_rules").TextHighlightRules;c_cppHighlightRules=function(){var a=new f,b=e.arrayToMap("and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|typeid|bitor|extern|protected|typename|bool|false|public|union|break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|friend|return|virtual|char|goto|short|void|class|if|signed|volatile|compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|switch|delete|new|template|do|not|this|for".split("|")),c=e.arrayToMap("NULL".split("|"));this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},a.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant",regex:"<[a-zA-Z0-9.]+>"},{token:"keyword",regex:"(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"},{token:function(a){return a=="this"?"variable.language":b.hasOwnProperty(a)?"keyword":c.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]},this.addRules(a.getRules(),"doc-"),this.$rules["doc-start"][0].next="start"},d.inherits(c_cppHighlightRules,g),b.c_cppHighlightRules=c_cppHighlightRules}),define("ace/mode/doc_comment_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc",regex:"\\*\\/",next:"start"},{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",regex:"s+"},{token:"comment.doc",regex:"TODO"},{token:"comment.doc",regex:"[^@\\*]+"},{token:"comment.doc",regex:"."}]}};d.inherits(f,e),function(){this.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}}}.call(f.prototype),b.DocCommentHighlightRules=f})
|
||||
|
|
@ -1 +1 @@
|
|||
define("ace/mode/coffee",function(a,b,c){function h(){this.$tokenizer=new d((new e).getRules()),this.$outdent=new f}var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/coffee_highlight_rules").CoffeeHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,g=a("ace/range").Range;a("pilot/oop").inherits(h,a("ace/mode/text").Mode);var i=h.prototype,j=/(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/,k=/^(\s*)#/,l=/^\s*###(?!#)/,m=/^\s*/;i.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;(!e.length||e[e.length-1].type!=="comment")&&a==="start"&&j.test(b)&&(d+=c);return d},i.toggleCommentLines=function(a,b,c,d){var e,f=new g(0,0,0,0);for(var h=c;h<=d;++h){var i=b.getLine(h);if(l.test(i))continue;i=(e=k.test(i))?i.replace(k,"$1"):i.replace(m,"$&#"),f.end.row=f.start.row=h,f.end.column=i.length+1,b.replace(f,i)}return 1-e*2},i.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},i.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)},b.Mode=h}),define("ace/mode/coffee_highlight_rules",function(a,b,c){function d(){var a="[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*",b="(?![$\\w]|\\s*:)",c={token:"string",regex:".+"};this.$rules={start:[{token:"identifier",regex:"(?:@|(?:\\.|::)\\s*)"+a},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof)|s(?:uper|witch)|return|b(?:reak|y)|c(?:ontinue|atch|lass)|i(?:n(?:stanceof)?|s(?:nt)?|f)|e(?:lse|xtends)|f(?:or (?:own)?|inally|unction)|wh(?:ile|en)|n(?:ew|ot?)|d(?:e(?:lete|bugger)|o)|loop|o(?:ff?|[rn])|un(?:less|til)|and|yes)"+b},{token:"constant.language",regex:"(?:true|false|null|undefined)"+b},{token:"invalid.illegal",regex:"(?:c(?:ase|onst)|default|function|v(?:ar|oid)|with|e(?:num|xport)|i(?:mplements|nterface)|let|p(?:ackage|r(?:ivate|otected)|ublic)|static|yield|__(?:hasProp|extends|slice|bind|indexOf))"+b},{token:"language.support.class",regex:"(?:Array|Boolean|Date|Function|Number|Object|R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|TypeError|URIError)"+b},{token:"language.support.function",regex:"(?:Math|JSON|is(?:NaN|Finite)|parse(?:Int|Float)|encodeURI(?:Component)?|decodeURI(?:Component)?)"+b},{token:"identifier",regex:a},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"},{token:"string",regex:"'''",next:"qdoc"},{token:"string",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string.regex",regex:"///",next:"heregex"},{token:"string.regex",regex:"/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"},{token:"comment",regex:"###(?!#)",next:"comment"},{token:"comment",regex:"#.*"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[\\]})]"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],qdoc:[{token:"string",regex:".*?'''",next:"start"},c],qqdoc:[{token:"string",regex:'.*?"""',next:"start"},c],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"start"},c],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"start"},c],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"start"},c],heregex:[{token:"string.regex",regex:".*?///[imgy]{0,4}",next:"start"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],comment:[{token:"comment",regex:".*?###",next:"start"},{token:"comment",regex:".+"}]}}a("pilot/oop").inherits(d,a("ace/mode/text_highlight_rules").TextHighlightRules),b.CoffeeHighlightRules=d})
|
||||
define("ace/mode/coffee",function(a,b,c){function j(){this.$tokenizer=new d((new e).getRules()),this.$outdent=new f}var d=a("ace/tokenizer").Tokenizer,e=a("ace/mode/coffee_highlight_rules").CoffeeHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,g=a("ace/range").Range,h=a("ace/mode/text").Mode,i=a("pilot/oop");i.inherits(j,h);var k=j.prototype,l=/(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/,m=/^(\s*)#/,n=/^\s*###(?!#)/,o=/^\s*/;k.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;(!e.length||e[e.length-1].type!=="comment")&&a==="start"&&l.test(b)&&(d+=c);return d},k.toggleCommentLines=function(a,b,c,d){console.log("toggle");var e=new g(0,0,0,0);for(var f=c;f<=d;++f){var h=b.getLine(f);if(n.test(h))continue;m.test(h)?h=h.replace(m,"$1"):h=h.replace(o,"$&#"),e.end.row=e.start.row=f,e.end.column=h.length+1,b.replace(e,h)}},k.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},k.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},b.Mode=j}),define("ace/mode/coffee_highlight_rules",function(a,b,c){function d(){var a="[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*",b="(?![$\\w]|\\s*:)",c={token:"string",regex:".+"};this.$rules={start:[{token:"identifier",regex:"(?:@|(?:\\.|::)\\s*)"+a},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof)|s(?:uper|witch)|return|b(?:reak|y)|c(?:ontinue|atch|lass)|i(?:n(?:stanceof)?|s(?:nt)?|f)|e(?:lse|xtends)|f(?:or (?:own)?|inally|unction)|wh(?:ile|en)|n(?:ew|ot?)|d(?:e(?:lete|bugger)|o)|loop|o(?:ff?|[rn])|un(?:less|til)|and|yes)"+b},{token:"constant.language",regex:"(?:true|false|null|undefined)"+b},{token:"invalid.illegal",regex:"(?:c(?:ase|onst)|default|function|v(?:ar|oid)|with|e(?:num|xport)|i(?:mplements|nterface)|let|p(?:ackage|r(?:ivate|otected)|ublic)|static|yield|__(?:hasProp|extends|slice|bind|indexOf))"+b},{token:"language.support.class",regex:"(?:Array|Boolean|Date|Function|Number|Object|R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|TypeError|URIError)"+b},{token:"language.support.function",regex:"(?:Math|JSON|is(?:NaN|Finite)|parse(?:Int|Float)|encodeURI(?:Component)?|decodeURI(?:Component)?)"+b},{token:"identifier",regex:a},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"},{token:"string",regex:"'''",next:"qdoc"},{token:"string",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string.regex",regex:"///",next:"heregex"},{token:"string.regex",regex:"/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"},{token:"comment",regex:"###(?!#)",next:"comment"},{token:"comment",regex:"#.*"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[\\]})]"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],qdoc:[{token:"string",regex:".*?'''",next:"start"},c],qqdoc:[{token:"string",regex:'.*?"""',next:"start"},c],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"start"},c],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"start"},c],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"start"},c],heregex:[{token:"string.regex",regex:".*?///[imgy]{0,4}",next:"start"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],comment:[{token:"comment",regex:".*?###",next:"start"},{token:"comment",regex:".+"}]}}a("pilot/oop").inherits(d,a("ace/mode/text_highlight_rules").TextHighlightRules),b.CoffeeHighlightRules=d})
|
||||
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
|
|
@ -1 +1 @@
|
|||
define("ace/mode/python",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:(?:[rubRUB])|(?:[ubUB][rR]))?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:(?:.)|(?:^"{3}))*?"{3}'},{token:"string",regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'},{token:"string",regex:f+"'{3}(?:(?:.)|(?:^'{3}))*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:^"{3})*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:^'{3})*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules})
|
||||
define("ace/mode/python",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[\:]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/python_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;PythonHighlightRules=function(){var a=e.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")),b=e.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")),c=e.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),d=e.arrayToMap("".split("|")),f="(?:r|u|ur|R|U|UR|Ur|uR)?",g="(?:(?:[1-9]\\d*)|(?:0))",h="(?:0[oO]?[0-7]+)",i="(?:0[xX][\\dA-Fa-f]+)",j="(?:0[bB][01]+)",k="(?:"+g+"|"+h+"|"+i+"|"+j+")",l="(?:[eE][+-]?\\d+)",m="(?:\\.\\d+)",n="(?:\\d+)",o="(?:(?:"+n+"?"+m+")|(?:"+n+"\\.))",p="(?:(?:"+o+"|"+n+")"+l+")",q="(?:"+p+"|"+o+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:f+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",regex:f+'"{3}.*$',next:"qqstring"},{token:"string",regex:f+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:f+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",regex:f+"'{3}.*$",next:"qstring"},{token:"string",regex:f+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+q+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:q},{token:"constant.numeric",regex:k+"[lL]\\b"},{token:"constant.numeric",regex:k+"\\b"},{token:function(e){return a.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"invalid.illegal":c.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"lparen",regex:"[\\[\\(\\{]"},{token:"rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",regex:".+"}]}},d.inherits(PythonHighlightRules,f),b.PythonHighlightRules=PythonHighlightRules})
|
||||
|
|
@ -1 +1 @@
|
|||
define("ace/mode/ruby",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h).replace(g,"$1");j.start.row=h,j.end.row=h,j.end.column=k.length+2,b.replace(j,k)}return-2}return b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/ruby_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;RubyHighlightRules=function(){var a=e.arrayToMap("abort|Array|at_exit|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|eval|exec|exit|exit!fail|Float|fork|format|gets|global_variables|gsub|gsub!|Integer|lambda|load|local_variables|loop|open|p|print|printf|proc|putc|puts|raise|rand|readline|readlines|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan".split("|")),b=e.arrayToMap("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|if|in|__LINE__|module|next|not|or|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield".split("|")),c=e.arrayToMap("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING".split("|")),d=e.arrayToMap("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE".split("|"));this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment",regex:"^=begin$",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(e){return e=="self"?"variable.language":b.hasOwnProperty(e)?"keyword":c.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"variable.language":a.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"^=end$",next:"start"},{token:"comment",regex:".+"}]}},d.inherits(RubyHighlightRules,f),b.RubyHighlightRules=RubyHighlightRules})
|
||||
define("ace/mode/ruby",function(a,b,c){var d=a("pilot/oop"),e=a("ace/mode/text").Mode,f=a("ace/tokenizer").Tokenizer,g=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,i=a("ace/range").Range,j=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h};d.inherits(j,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=[],g=/^(\s*)#/;for(var h=c;h<=d;h++)if(!g.test(b.getLine(h))){e=!1;break}if(e){var j=new i(0,0,0,0);for(var h=c;h<=d;h++){var k=b.getLine(h),l=k.match(g);j.start.row=h,j.end.row=h,j.end.column=l[0].length,b.replace(j,l[1])}}else b.indentRows(c,d,"#")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"){var h=b.match(/^.*[\{\(\[]\s*$/);h&&(d+=c)}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)}}.call(j.prototype),b.Mode=j}),define("ace/mode/ruby_highlight_rules",function(a,b,c){var d=a("pilot/oop"),e=a("pilot/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules;RubyHighlightRules=function(){var a=e.arrayToMap("abort|Array|at_exit|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|eval|exec|exit|exit!fail|Float|fork|format|gets|global_variables|gsub|gsub!|Integer|lambda|load|local_variables|loop|open|p|print|printf|proc|putc|puts|raise|rand|readline|readlines|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan".split("|")),b=e.arrayToMap("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|if|in|__LINE__|module|next|not|or|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield".split("|")),c=e.arrayToMap("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING".split("|")),d=e.arrayToMap("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE".split("|"));this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment",regex:"^=begin$",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:function(e){return e=="self"?"variable.language":b.hasOwnProperty(e)?"keyword":c.hasOwnProperty(e)?"constant.language":d.hasOwnProperty(e)?"variable.language":a.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"^=end$",next:"start"},{token:"comment",regex:".+"}]}},d.inherits(RubyHighlightRules,f),b.RubyHighlightRules=RubyHighlightRules})
|
||||
Loading…
Add table
Add a link
Reference in a new issue