kopia lustrzana https://github.com/c9/core
fix loading of modes from bundles
rodzic
e69a78dd40
commit
0cf55559e2
|
@ -1223,8 +1223,11 @@ define(function(require, exports, module) {
|
||||||
tabs.getTabs().forEach(function(tab) {
|
tabs.getTabs().forEach(function(tab) {
|
||||||
if (tab.editorType == "ace") {
|
if (tab.editorType == "ace") {
|
||||||
var c9Session = tab.document.getSession();
|
var c9Session = tab.document.getSession();
|
||||||
if (c9Session && c9Session.session)
|
if (c9Session && c9Session.session) {
|
||||||
detectSyntax(c9Session, tab.path);
|
var syntax = getSyntax(c9Session, tab.path);
|
||||||
|
if (syntax)
|
||||||
|
c9Session.setOption("syntax", syntax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 50);
|
}, 50);
|
||||||
|
@ -1239,6 +1242,7 @@ define(function(require, exports, module) {
|
||||||
modes.byCaption[opts.caption] = opts;
|
modes.byCaption[opts.caption] = opts;
|
||||||
modes.byName[name] = opts;
|
modes.byName[name] = opts;
|
||||||
|
|
||||||
|
opts.order = opts.order || 0;
|
||||||
if (!opts.extensions)
|
if (!opts.extensions)
|
||||||
opts.extensions = "";
|
opts.extensions = "";
|
||||||
|
|
||||||
|
|
|
@ -327,10 +327,10 @@ define(function(require, exports, module) {
|
||||||
});
|
});
|
||||||
|
|
||||||
services.ace.defineSyntax({
|
services.ace.defineSyntax({
|
||||||
name: join(pluginName, "modes", path),
|
name: path,
|
||||||
caption: mode.caption,
|
caption: mode.caption,
|
||||||
extensions: (mode.extensions || "").trim()
|
extensions: (mode.extensions || "").trim()
|
||||||
.replace(/\s*,\s*/g, "|")
|
.replace(/\s*,\s*/g, "|").replace(/(^|\|)\./g, "$1")
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "outline":
|
case "outline":
|
||||||
|
|
Ładowanie…
Reference in New Issue