Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit a82cab1

Browse files
author
Marcel Gerber
committed
Handle undefined theme the right way
1 parent e3bf0fa commit a82cab1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/view/ThemeManager.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ define(function (require, exports, module) {
4141
var loadedThemes = {},
4242
currentTheme = null,
4343
styleNode = $(ExtensionUtils.addEmbeddedStyleSheet("")),
44-
defaultTheme = "thor-light-theme",
44+
defaultTheme = "light-theme",
4545
commentRegex = /\/\*([\s\S]*?)\*\//mg,
4646
scrollbarsRegex = /((?:[^}|,]*)::-webkit-scrollbar(?:[^{]*)[{](?:[^}]*?)[}])/mgi,
4747
stylesPath = FileUtils.getNativeBracketsDirectoryPath() + "/styles/";
@@ -266,10 +266,8 @@ define(function (require, exports, module) {
266266
var cm = editor._codeMirror;
267267
ThemeView.updateThemes(cm);
268268

269-
// currentTheme can be undefined if you reloaded without extensions
270-
if (currentTheme && currentTheme.addModeClass !== undefined) {
271-
cm.setOption("addModeClass", currentTheme.addModeClass);
272-
}
269+
// currentTheme can be undefined, so watch out
270+
cm.setOption("addModeClass", !!(currentTheme && currentTheme.addModeClass));
273271
});
274272
}
275273

0 commit comments

Comments
 (0)