Build update.
This commit is contained in:
parent
8e7a4f61c4
commit
b2dcbf9fa3
53 changed files with 272 additions and 182 deletions
|
|
@ -2371,6 +2371,16 @@ var Keys = (function() {
|
|||
44 : "Print",
|
||||
45 : "Insert",
|
||||
46 : "Delete",
|
||||
96 : "Numpad0",
|
||||
97 : "Numpad1",
|
||||
98 : "Numpad2",
|
||||
99 : "Numpad3",
|
||||
100: "Numpad4",
|
||||
101: "Numpad5",
|
||||
102: "Numpad6",
|
||||
103: "Numpad7",
|
||||
104: "Numpad8",
|
||||
105: "Numpad9",
|
||||
112: "F1",
|
||||
113: "F2",
|
||||
114: "F3",
|
||||
|
|
@ -2541,7 +2551,7 @@ exports.isOldIE = exports.isIE && exports.isIE < 9;
|
|||
exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko";
|
||||
|
||||
/** oldGecko == rev < 2.0 **/
|
||||
exports.isOldGecko = exports.isGecko && /rv\:1/.test(navigator.userAgent);
|
||||
exports.isOldGecko = exports.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1]) < 4;
|
||||
|
||||
/** Is this Opera */
|
||||
exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]";
|
||||
|
|
@ -4084,7 +4094,7 @@ var Editor = function(renderer, session) {
|
|||
|
||||
var rows = this.$getSelectedRows();
|
||||
var range;
|
||||
if (rows.last == 0 || rows.last+1 < this.session.getLength())
|
||||
if (rows.first == 0 || rows.last+1 < this.session.getLength())
|
||||
range = new Range(rows.first, 0, rows.last+1, 0);
|
||||
else
|
||||
range = new Range(
|
||||
|
|
@ -4142,14 +4152,24 @@ var Editor = function(renderer, session) {
|
|||
|
||||
this.$moveLines = function(mover) {
|
||||
var rows = this.$getSelectedRows();
|
||||
var selection = this.selection;
|
||||
if (!selection.isMultiLine()) {
|
||||
var range = selection.getRange();
|
||||
var reverse = selection.isBackwards();
|
||||
}
|
||||
|
||||
var linesMoved = mover.call(this, rows.first, rows.last);
|
||||
|
||||
var selection = this.selection;
|
||||
selection.setSelectionAnchor(rows.last+linesMoved+1, 0);
|
||||
selection.$moveSelection(function() {
|
||||
selection.moveCursorTo(rows.first+linesMoved, 0);
|
||||
});
|
||||
if (range) {
|
||||
range.start.row += linesMoved;
|
||||
range.end.row += linesMoved;
|
||||
selection.setSelectionRange(range, reverse);
|
||||
} else {
|
||||
selection.setSelectionAnchor(rows.last+linesMoved+1, 0);
|
||||
selection.$moveSelection(function() {
|
||||
selection.moveCursorTo(rows.first+linesMoved, 0);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.$getSelectedRows = function() {
|
||||
|
|
@ -7208,9 +7228,11 @@ var EditSession = function(text, mode) {
|
|||
var row = firstRow;
|
||||
lastRow = Math.min(lastRow, lines.length - 1);
|
||||
while (row <= lastRow) {
|
||||
foldLine = this.getFoldLine(row);
|
||||
foldLine = this.getFoldLine(row, foldLine);
|
||||
if (!foldLine) {
|
||||
tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row]));
|
||||
wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
row ++;
|
||||
} else {
|
||||
tokens = [];
|
||||
foldLine.walk(
|
||||
|
|
@ -7234,16 +7256,13 @@ var EditSession = function(text, mode) {
|
|||
lines[foldLine.end.row].length + 1
|
||||
);
|
||||
// Remove spaces/tabs from the back of the token array.
|
||||
while (tokens.length != 0
|
||||
&& tokens[tokens.length - 1] >= SPACE)
|
||||
{
|
||||
while (tokens.length != 0 && tokens[tokens.length - 1] >= SPACE)
|
||||
tokens.pop();
|
||||
}
|
||||
}
|
||||
wrapData[row] =
|
||||
this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
|
||||
row = this.getRowFoldEnd(row) + 1;
|
||||
wrapData[foldLine.start.row]
|
||||
= this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
row = foldLine.end.row + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -7534,9 +7553,7 @@ var EditSession = function(text, mode) {
|
|||
}
|
||||
var doCache = !rowCache.length || i == rowCache.length;
|
||||
|
||||
// clamp row before clamping column, for selection on last line
|
||||
var maxRow = this.getLength() - 1;
|
||||
|
||||
var foldLine = this.getNextFoldLine(docRow);
|
||||
var foldStart = foldLine ? foldLine.start.row : Infinity;
|
||||
|
||||
|
|
@ -7561,18 +7578,24 @@ var EditSession = function(text, mode) {
|
|||
}
|
||||
}
|
||||
|
||||
if (foldLine && foldLine.start.row <= docRow)
|
||||
if (foldLine && foldLine.start.row <= docRow) {
|
||||
line = this.getFoldDisplayLine(foldLine);
|
||||
else {
|
||||
docRow = foldLine.start.row;
|
||||
} else if (row + rowLength <= screenRow || docRow > maxRow) {
|
||||
// clip at the end of the document
|
||||
return {
|
||||
row: maxRow,
|
||||
column: this.getLine(maxRow).length
|
||||
}
|
||||
} else {
|
||||
line = this.getLine(docRow);
|
||||
foldLine = null;
|
||||
}
|
||||
|
||||
var splits = [];
|
||||
if (this.$useWrapMode) {
|
||||
splits = this.$wrapData[docRow];
|
||||
var splits = this.$wrapData[docRow];
|
||||
if (splits) {
|
||||
column = splits[screenRow - row]
|
||||
column = splits[screenRow - row];
|
||||
if(screenRow > row && splits.length) {
|
||||
docColumn = splits[screenRow - row - 1] || splits[splits.length - 1];
|
||||
line = line.substring(docColumn);
|
||||
|
|
@ -7582,10 +7605,6 @@ var EditSession = function(text, mode) {
|
|||
|
||||
docColumn += this.$getStringScreenWidth(line, screenColumn)[1];
|
||||
|
||||
// clip row at the end of the document
|
||||
if (row + splits.length < screenRow)
|
||||
docColumn = Number.MAX_VALUE;
|
||||
|
||||
// Need to do some clamping action here.
|
||||
if (this.$useWrapMode) {
|
||||
if (docColumn >= column) {
|
||||
|
|
@ -7724,24 +7743,29 @@ var EditSession = function(text, mode) {
|
|||
|
||||
this.getScreenLength = function() {
|
||||
var screenRows = 0;
|
||||
var lastFoldLine = null;
|
||||
var foldLine = null;
|
||||
var fold = null;
|
||||
if (!this.$useWrapMode) {
|
||||
screenRows = this.getLength();
|
||||
|
||||
// Remove the folded lines again.
|
||||
var foldData = this.$foldData;
|
||||
for (var i = 0; i < foldData.length; i++) {
|
||||
foldLine = foldData[i];
|
||||
screenRows -= foldLine.end.row - foldLine.start.row;
|
||||
fold = foldData[i];
|
||||
screenRows -= fold.end.row - fold.start.row;
|
||||
}
|
||||
} else {
|
||||
for (var row = 0; row < this.$wrapData.length; row++) {
|
||||
if (foldLine = this.getFoldLine(row, lastFoldLine)) {
|
||||
row = foldLine.end.row;
|
||||
screenRows += 1;
|
||||
} else {
|
||||
screenRows += this.$wrapData[row].length + 1;
|
||||
var lastRow = this.$wrapData.length;
|
||||
var row = 0, i = 0;
|
||||
var fold = this.$foldData[i++];
|
||||
var foldStart = fold ? fold.start.row :Infinity;
|
||||
|
||||
while (row < lastRow) {
|
||||
screenRows += this.$wrapData[row].length + 1;
|
||||
row ++;
|
||||
if (row > foldStart) {
|
||||
row = fold.end.row+1;
|
||||
fold = this.$foldData[i++];
|
||||
foldStart = fold ?fold.start.row :Infinity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11182,7 +11206,7 @@ Search.SELECTION = 2;
|
|||
var searchSelection = this.$options.scope == Search.SELECTION;
|
||||
|
||||
var range = this.$options.range || session.getSelection().getRange();
|
||||
var start = this.$options.start || session.getSelection().getCursor();
|
||||
var start = this.$options.start || range[searchSelection ? "start" : "end"];
|
||||
|
||||
var firstRow = searchSelection ? range.start.row : 0;
|
||||
var firstColumn = searchSelection ? range.start.column : 0;
|
||||
|
|
@ -11244,7 +11268,7 @@ Search.SELECTION = 2;
|
|||
var searchSelection = this.$options.scope == Search.SELECTION;
|
||||
|
||||
var range = this.$options.range || session.getSelection().getRange();
|
||||
var start = this.$options.start || session.getSelection().getCursor();
|
||||
var start = this.$options.start || range[searchSelection ? "end" : "start"];
|
||||
|
||||
var firstRow = searchSelection ? range.start.row : 0;
|
||||
var firstColumn = searchSelection ? range.start.column : 0;
|
||||
|
|
@ -12234,6 +12258,11 @@ var VirtualRenderer = function(container, theme) {
|
|||
if (_self.$theme)
|
||||
dom.addCssClass(_self.container, _self.$theme);
|
||||
|
||||
if (theme && theme.isDark)
|
||||
dom.addCssClass(_self.container, "ace_dark");
|
||||
else
|
||||
dom.removeCssClass(_self.container, "ace_dark");
|
||||
|
||||
// force re-measure of the gutter width
|
||||
if (_self.$size) {
|
||||
_self.$size.width = 0;
|
||||
|
|
@ -12831,6 +12860,7 @@ var Text = function(parentEl) {
|
|||
var foldLine = this.session.getFoldLine(row);
|
||||
if (foldLine) {
|
||||
if (foldLine.containsRow(first)) {
|
||||
first = foldLine.start.row;
|
||||
break;
|
||||
} else {
|
||||
row = foldLine.end.row;
|
||||
|
|
@ -12894,12 +12924,12 @@ var Text = function(parentEl) {
|
|||
foldStart = fold ?fold.start.row :Infinity;
|
||||
|
||||
while (true) {
|
||||
if(row > foldStart) {
|
||||
if (row > foldStart) {
|
||||
row = fold.end.row+1;
|
||||
fold = this.session.getNextFoldLine(row, fold);
|
||||
foldStart = fold ?fold.start.row :Infinity;
|
||||
}
|
||||
if(row > lastRow)
|
||||
if (row > lastRow)
|
||||
break;
|
||||
|
||||
var container = dom.createElement("div");
|
||||
|
|
@ -12941,12 +12971,12 @@ var Text = function(parentEl) {
|
|||
foldStart = fold ?fold.start.row :Infinity;
|
||||
|
||||
while (true) {
|
||||
if(row > foldStart) {
|
||||
if (row > foldStart) {
|
||||
row = fold.end.row+1;
|
||||
fold = this.session.getNextFoldLine(row, fold);
|
||||
foldStart = fold ?fold.start.row :Infinity;
|
||||
}
|
||||
if(row > lastRow)
|
||||
if (row > lastRow)
|
||||
break;
|
||||
|
||||
if (this.$useLineGroups())
|
||||
|
|
@ -13743,7 +13773,7 @@ define("text!ace/css/editor.css", [], "@import url(//fonts.googleapis.com/css?fa
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-tm";
|
||||
exports.cssText = ".ace-tm .ace_editor {\
|
||||
border: 2px solid rgb(159, 159, 159);\
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue