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:
Sebastian Serth
2023-09-12 18:45:47 +02:00
parent 13bd68d760
commit 60656443e2
210 changed files with 66466 additions and 33266 deletions

View File

@ -10,15 +10,11 @@ var XmlHighlightRules = function(normalize) {
this.$rules = {
start : [
{token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
{
token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
},
{
token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
},
{token : "comment.xml", regex : "<\\!--", next : "comment"},
{token : "comment.start.xml", regex : "<\\!--", next : "comment"},
{
token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
@ -30,9 +26,9 @@ var XmlHighlightRules = function(normalize) {
{defaultToken : "text.xml"}
],
xml_decl : [{
processing_instruction : [{
token : "entity.other.attribute-name.decl-attribute-name.xml",
regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
regex : tagRegex
}, {
token : "keyword.operator.decl-attribute-equals.xml",
regex : "="
@ -46,11 +42,6 @@ var XmlHighlightRules = function(normalize) {
next : "start"
}],
processing_instruction : [
{token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
{defaultToken : "instruction.xml"}
],
doctype : [
{include : "whitespace"},
{include : "string"},
@ -88,7 +79,7 @@ var XmlHighlightRules = function(normalize) {
],
comment : [
{token : "comment.xml", regex : "-->", next : "start"},
{token : "comment.end.xml", regex : "-->", next : "start"},
{defaultToken : "comment.xml"}
],
@ -135,7 +126,7 @@ var XmlHighlightRules = function(normalize) {
attributes: [{
token : "entity.other.attribute-name.xml",
regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
regex : tagRegex
}, {
token : "keyword.operator.attribute-equals.xml",
regex : "="
@ -188,7 +179,7 @@ var XmlHighlightRules = function(normalize) {
stack.splice(0);
return this.token;
}}
]
];
this.embedRules(HighlightRules, prefix, [{
token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
@ -281,7 +272,7 @@ var XmlBehaviour = function () {
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
if (text == '>') {
var position = editor.getCursorPosition();
var position = editor.getSelectionRange().start;
var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken() || iterator.stepBackward();
if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
@ -299,6 +290,10 @@ var XmlBehaviour = function () {
}
while (!is(token, "tag-name")) {
token = iterator.stepBackward();
if (token.value == "<") {
token = iterator.stepForward();
break;
}
}
var tokenRow = iterator.getCurrentTokenRow();
@ -410,7 +405,7 @@ function is(token, type) {
var tag = this._getFirstTagInLine(session, row);
if (!tag)
return "";
return this.getCommentFoldWidget(session, row);
if (tag.closing || (!tag.tagName && tag.selfClosing))
return foldStyle == "markbeginend" ? "end" : "";
@ -423,6 +418,12 @@ function is(token, type) {
return "start";
};
this.getCommentFoldWidget = function(session, row) {
if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
return "start";
return "";
};
this._getFirstTagInLine = function(session, row) {
var tokens = session.getTokens(row);
var tag = new Tag();
@ -541,8 +542,10 @@ function is(token, type) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var firstTag = this._getFirstTagInLine(session, row);
if (!firstTag)
return null;
if (!firstTag) {
return this.getCommentFoldWidget(session, row)
&& session.getCommentFoldRange(row, session.getLine(row).length);
}
var isBackward = firstTag.closing || firstTag.selfClosing;
var stack = [];