Update ACE Editor to version 1.2.9
The new ACE editor introduces full support for emojis (and, thereby, UTF-16 characters with high- and low-surrogates). Hence, we can remove our custom fix. Further, this update will allow emojis to be used in pair programming sessions.
This commit is contained in:
29
vendor/assets/javascripts/ace/ext-whitespace.js
vendored
29
vendor/assets/javascripts/ace/ext-whitespace.js
vendored
@@ -38,7 +38,7 @@ exports.$detectIndentation = function(lines, fallback) {
|
||||
return score;
|
||||
}
|
||||
|
||||
var changesTotal = changes.reduce(function(a,b){return a+b}, 0);
|
||||
var changesTotal = changes.reduce(function(a,b){return a+b;}, 0);
|
||||
|
||||
var first = {score: 0, length: 0};
|
||||
var spaceIndents = 0;
|
||||
@@ -82,17 +82,38 @@ exports.detectIndentation = function(session) {
|
||||
session.setTabSize(indent.length);
|
||||
return indent;
|
||||
};
|
||||
|
||||
exports.trimTrailingSpace = function(session, trimEmpty) {
|
||||
exports.trimTrailingSpace = function(session, options) {
|
||||
var doc = session.getDocument();
|
||||
var lines = doc.getAllLines();
|
||||
|
||||
var min = trimEmpty ? -1 : 0;
|
||||
var min = options && options.trimEmpty ? -1 : 0;
|
||||
var cursors = [], ci = -1;
|
||||
if (options && options.keepCursorPosition) {
|
||||
if (session.selection.rangeCount) {
|
||||
session.selection.rangeList.ranges.forEach(function(x, i, ranges) {
|
||||
var next = ranges[i + 1];
|
||||
if (next && next.cursor.row == x.cursor.row)
|
||||
return;
|
||||
cursors.push(x.cursor);
|
||||
});
|
||||
} else {
|
||||
cursors.push(session.selection.getCursor());
|
||||
}
|
||||
ci = 0;
|
||||
}
|
||||
var cursorRow = cursors[ci] && cursors[ci].row;
|
||||
|
||||
for (var i = 0, l=lines.length; i < l; i++) {
|
||||
var line = lines[i];
|
||||
var index = line.search(/\s+$/);
|
||||
|
||||
if (i == cursorRow) {
|
||||
if (index < cursors[ci].column && index > min)
|
||||
index = cursors[ci].column;
|
||||
ci++;
|
||||
cursorRow = cursors[ci] ? cursors[ci].row : -1;
|
||||
}
|
||||
|
||||
if (index > min)
|
||||
doc.removeInLine(i, index, line.length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user