Edditoria / markdown-plus-plus

Markdown syntax highlighting for Notepad++, by customized UDL file (user defined language)
MIT License
1.5k stars 277 forks source link

Auto match udl scheme with the current theme #68

Open graphixillusion opened 2 years ago

graphixillusion commented 2 years ago

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):

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 commented 2 years ago

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:

Thanks for your question.

graphixillusion commented 2 years ago

@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.