Created
April 4, 2014 12:34
-
-
Save MiguelCastillo/9973772 to your computer and use it in GitHub Desktop.
Brackets loading CodeMirror addon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Brackets Themse Copyright (c) 2014 Miguel Castillo. | |
* | |
* Licensed under MIT | |
*/ | |
define(function (require, exports, module) { | |
"use strict"; | |
var spromise = require("lib/spromise"); | |
function initAddons() { | |
// Set some default value for codemirror... | |
CodeMirror.defaults.highlightSelectionMatches = true; | |
CodeMirror.defaults.styleSelectedText = true; | |
} | |
function init() { | |
/** | |
* This is where is all starts to load up... | |
*/ | |
var promises = [ | |
// Load up codemirror addon for active lines | |
spromise(function(resolve) { | |
brackets.getModule(["thirdparty/CodeMirror2/addon/selection/mark-selection"], resolve); | |
}), | |
spromise(function(resolve) { | |
brackets.getModule(["thirdparty/CodeMirror2/addon/search/match-highlighter"], resolve); | |
}) | |
]; | |
return spromise.when.apply((void 0), promises).done(initAddons); | |
} | |
return { | |
ready: init().done | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment