Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Support themes and dark mode for external lexers #12190

Open
blu3mania opened this issue Sep 17, 2022 · 0 comments
Open

Enhancement: Support themes and dark mode for external lexers #12190

blu3mania opened this issue Sep 17, 2022 · 0 comments

Comments

@blu3mania
Copy link
Contributor

blu3mania commented Sep 17, 2022

Description of the enhancement

In current code, themes are supported for built-in lexers by having all of their styles list in individual theme configuration files under {data folder}\themes. However, for external lexers there isn't such a thing, The styles are always loaded and stored (when user configured) to {plugin}.xml under {data folder}\plugins\config, regardless what theme is currently used/configured for. This should be enhanced for better user experience, especially for users who switch between default and dark mode depending on the time of the day.

@donho If you don't mind, I can try to work on this. My idea is to have a new "themes" folder under {data folder}\plugins\config, and for each theme, a sub-folder under it to store each individual plugin's styling configuration. For example, for my Papyrus plugin, the config file for dark mode will be stored in {data folder}\plugins\config\themes\DarkModeDefault\Papyrus.xml.

To be compatible with existing lexer plugins, the logic for loading styles in current theme would be:

  • Check if {data folder}\plugins\config\themes{theme} exists
    • If yes, check if {data folder}\plugins\config\themes{theme}{plugin}.xml exists
      • If yes, load from it
  • In all other cases, load from {data folder}\plugins\config{plugin}.xml and save a copy as {data folder}\plugins\config\themes{theme}{plugin}.xml

The logic for style configurator is simple. It will always save to {data folder}\plugins\config\themes{configured theme}{plugin}.xml for external lexers.

Please let me know your thoughts. Thanks.

blu3mania added a commit to blu3mania/notepad-plus-plus that referenced this issue Oct 5, 2022
…theme (or dark mode) gets applied, external lexer's config will be loaded from {data folder}\plugins\config\themes{theme}. If this folder doesn't exist or the config file for the lexer doesn't exist, it is copied from the lexer's base config file under {data folder}\plugins\config.

Also fixed the logic to insert disabled language back to Language menu after it is re-enabled, which also applies to adding external lexers to Language menu when Notepadd++ starts.

This closes notepad-plus-plus#12190
blu3mania added a commit to blu3mania/notepad-plus-plus that referenced this issue Oct 5, 2022
…theme (or dark mode) gets applied, external lexer's config will be loaded from {data folder}\plugins\config\themes{theme}. If this folder doesn't exist or the config file for the lexer doesn't exist, it is copied from the lexer's base config file under {data folder}\plugins\config.

Also fixed the logic to insert disabled language back to Language menu after it is re-enabled, which also applies to adding external lexers to Language menu when Notepadd++ starts.

This closes notepad-plus-plus#12190
blu3mania added a commit to blu3mania/notepad-plus-plus that referenced this issue Feb 1, 2023
…theme (or dark mode) gets applied, external lexer's config will be loaded from {data folder}\plugins\config\themes{theme}. If this folder doesn't exist or the config file for the lexer doesn't exist, it is copied from the lexer's base config file under {data folder}\plugins\config.

Also fixed the logic to insert disabled language back to Language menu after it is re-enabled, which also applies to adding external lexers to Language menu when Notepadd++ starts.

This closes notepad-plus-plus#12190
blu3mania added a commit to blu3mania/notepad-plus-plus that referenced this issue Feb 1, 2023
…theme (or dark mode) gets applied, external lexer's config will be loaded from {data folder}\plugins\config\themes{theme}. If this folder doesn't exist or the config file for the lexer doesn't exist, it is copied from the lexer's base config file under {data folder}\plugins\config.

Also fixed the logic to insert disabled language back to Language menu after it is re-enabled, which also applies to adding external lexers to Language menu when Notepadd++ starts.

This closes notepad-plus-plus#12190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant