Merge pull request #1526 from ajaxorg/site

Dogfood
This commit is contained in:
Lennart Kats 2013-07-22 07:14:56 -07:00
commit b204b53e78
4 changed files with 225 additions and 151 deletions

View file

@ -56,7 +56,8 @@ var config = require("../config");
*/
exports.render = function(input, mode, theme, lineStart, disableGutter, callback) {
var waiting = 0
var waiting = 0;
var modeCache = EditSession.prototype.$modes;
// if either the theme or the mode were specified as objects
// then we need to lazily load them.
@ -71,7 +72,8 @@ exports.render = function(input, mode, theme, lineStart, disableGutter, callback
if (typeof mode == "string") {
waiting++;
config.loadModule(['mode', mode], function(m) {
mode = new m.Mode()
if (!modeCache[mode]) modeCache[mode] = new m.Mode();
mode = modeCache[mode];
--waiting || done();
});
}