Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/view/ThemeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ define(function (require, exports, module) {
options.name = options.name.toLocaleLowerCase().replace(/[\W]/g, '-');
}

this.file = file;
this.name = options.name;
this.displayName = options.title || toDisplayName(fileName);
this.dark = options.theme !== undefined && options.theme.dark === true;
this.file = file;
this.name = options.name;
this.displayName = options.title || toDisplayName(fileName);
this.dark = options.theme !== undefined && options.theme.dark === true;
this.addModeClass = options.theme !== undefined && options.theme.addModeClass === true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a theme setting in the theme dialog, otherwise users would have to go to specific themes package.json to disable this. Similar to enable/disable scrollbars. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. The setting itself is not immediately user-visible (while custom scrollbars are) and some themes just wouldn't work without this setting.
So for example, IIRC one asked for this particular feature when he wanted to create an authentic-looking Notepad++ theme. Such a theme just wouldn't be possible without this option set.

}


Expand Down Expand Up @@ -249,7 +250,7 @@ define(function (require, exports, module) {
/**
* Refresh current theme in the editor
*
* @param {boolean} force Forces a reload the current theme. It reload the theme file.
* @param {boolean} force Forces a reload of the current theme. It reloads the theme file.
*/
function refresh(force) {
if (force) {
Expand All @@ -264,6 +265,7 @@ define(function (require, exports, module) {

var cm = editor._codeMirror;
ThemeView.updateThemes(cm);
cm.setOption("addModeClass", currentTheme.addModeClass);
});
}

Expand Down