From 0cf55559e29f9ef29a1d2c26ad52c52ca189d4c8 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 18 Apr 2015 01:12:13 +0400 Subject: [PATCH] fix loading of modes from bundles --- plugins/c9.ide.ace/ace.js | 8 ++++++-- plugins/c9.ide.plugins/debug.js | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/c9.ide.ace/ace.js b/plugins/c9.ide.ace/ace.js index d1f1e89c..4609d862 100644 --- a/plugins/c9.ide.ace/ace.js +++ b/plugins/c9.ide.ace/ace.js @@ -1223,8 +1223,11 @@ define(function(require, exports, module) { tabs.getTabs().forEach(function(tab) { if (tab.editorType == "ace") { var c9Session = tab.document.getSession(); - if (c9Session && c9Session.session) - detectSyntax(c9Session, tab.path); + if (c9Session && c9Session.session) { + var syntax = getSyntax(c9Session, tab.path); + if (syntax) + c9Session.setOption("syntax", syntax); + } } }); }, 50); @@ -1239,6 +1242,7 @@ define(function(require, exports, module) { modes.byCaption[opts.caption] = opts; modes.byName[name] = opts; + opts.order = opts.order || 0; if (!opts.extensions) opts.extensions = ""; diff --git a/plugins/c9.ide.plugins/debug.js b/plugins/c9.ide.plugins/debug.js index f9c8729e..1e7b358e 100644 --- a/plugins/c9.ide.plugins/debug.js +++ b/plugins/c9.ide.plugins/debug.js @@ -327,10 +327,10 @@ define(function(require, exports, module) { }); services.ace.defineSyntax({ - name: join(pluginName, "modes", path), + name: path, caption: mode.caption, extensions: (mode.extensions || "").trim() - .replace(/\s*,\s*/g, "|") + .replace(/\s*,\s*/g, "|").replace(/(^|\|)\./g, "$1") }); break; case "outline":