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

Commit b36ebe9

Browse files
Merge pull request #10039 from MarcelGerber/themes-mode-class
Add theme option addModeClass (for language-aware themes)
2 parents fb54d27 + 9182982 commit b36ebe9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/view/ThemeManager.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ define(function (require, exports, module) {
9696
options.name = options.name.toLocaleLowerCase().replace(/[\W]/g, '-');
9797
}
9898

99-
this.file = file;
100-
this.name = options.name;
101-
this.displayName = options.title || toDisplayName(fileName);
102-
this.dark = options.theme !== undefined && options.theme.dark === true;
99+
this.file = file;
100+
this.name = options.name;
101+
this.displayName = options.title || toDisplayName(fileName);
102+
this.dark = options.theme !== undefined && options.theme.dark === true;
103+
this.addModeClass = options.theme !== undefined && options.theme.addModeClass === true;
103104
}
104105

105106

@@ -249,7 +250,7 @@ define(function (require, exports, module) {
249250
/**
250251
* Refresh current theme in the editor
251252
*
252-
* @param {boolean} force Forces a reload the current theme. It reload the theme file.
253+
* @param {boolean} force Forces a reload of the current theme. It reloads the theme file.
253254
*/
254255
function refresh(force) {
255256
if (force) {
@@ -264,6 +265,7 @@ define(function (require, exports, module) {
264265

265266
var cm = editor._codeMirror;
266267
ThemeView.updateThemes(cm);
268+
cm.setOption("addModeClass", currentTheme.addModeClass);
267269
});
268270
}
269271

0 commit comments

Comments
 (0)