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

Auto match udl scheme with the current theme #68

Open
graphixillusion opened this issue Sep 29, 2022 · 2 comments
Open

Auto match udl scheme with the current theme #68

graphixillusion opened this issue Sep 29, 2022 · 2 comments

Comments

@graphixillusion
Copy link

Hi there. As the title says, is there any way to auto match the markdown's style with the current theme when you have multiple scheme files inside the userDefineLangs folder? Let me explain better this scenario:

Dark Mode Enabled in settings;
Currently selected theme = Zenburn under Settings --> Style Configurator

Inside the userDefineLangs folder i have those two files (for example):

  • markdown.bespin.dark.udl
  • markdown.zenburn.dark.udl

In this scenario, when i try to open a .md file with notepad, it will always autoselect the markdown.bespin.dark.udl (maybe becouse of alphabetically orders of the theme's name). I can change it back to zenburn dark after the file is loaded under Notepad++ but if i close Notepad++ and reopen another .md file, it auto select the markdown.bespin.dark.udl style again.

For now the only workaround i've found is to have only one style inside the userDefineLangs folder which match the current theme.

Any clue? Thank you!

@Edditoria
Copy link
Owner

Sorry but it cannot be done in UDL file (or I don't know how to do it).

Notepad++ loads a UDL file using filename in the UDL folder. So it will always load "b"espin in your case. For your reference, the bundled UDL will load at last because its filename is "markdown.default...". The underscore "" has lower priority for NPP. It is confirmed by NPP author.

In summary, for each syntax, e.g. markdown, NPP will load the first file that matches ext="md markdown". And:

  • for dark theme: The XML file will contains darkModeTheme="yes" (filename ".dark.udl.xml" is for human reading only), and
  • for light theme: The XML file does not have darkModeTheme="yes".

Thanks for your question.

@graphixillusion
Copy link
Author

@Edditoria thank you for answering. After your explanation i've tried to rename the udl files in a way that "markdown.zenburn.dark.udl" comes first (alphabetically) than "markdown.bespin.dark.udl" (i named it #markdown.zenburn.dark.udl): using this name, NPP loads it instead the bespin one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants