Load scrollbar styling based on whether or not theme scrollbars are enabled.
function updateScrollbars(theme) {
theme = theme || {};
if (prefs.get("themeScrollbars")) {
var scrollbar = (theme.scrollbar || []).join(" ");
$scrollbars.text(scrollbar || "");
} else {
$scrollbars.text("");
}
}
Handles updating codemirror with the current selection of themes.
function updateThemes(cm) {
var newTheme = prefs.get("theme"),
cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string
// Check if the editor already has the theme applied...
if (cmTheme === newTheme) {
return;
}
// Setup current and further documents to get the new theme...
CodeMirror.defaults.theme = newTheme;
cm.setOption("theme", newTheme);
}
exports.updateScrollbars = updateScrollbars;
exports.updateThemes = updateThemes;
});