Dark Mode inverts texts after saving.
I am not a programmer and only use Notepad ++ for creating flat texts. Adding a Dark mode was a good idea. However, when I insert a text and save it the text inverts to a white background and dark text, spaces are also dark. This looks very weird.
How can this be solved?
I am not sure what you mean by that. For me, a saved file works the same as an unsaved or new file, and all display as expected in v8.1.1 Dark Mode – light text on dark background.
Could you share your ?-menu Debug Info, as well as a screenshot of your Settings > Style Configurator showing your selected Theme?
Notepad++ v8.1.1 (64-bit) Build time : Jul 1 2021 - 14:10:53 Path : C:\usr\local\apps\npp\npp.8.1.1.portable.x64\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 1903 OS Build : 18362.1256 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll
(And if your screenshot could also show an image of the offending wrongly-colored text…)
Here is an example
Thank you for the screenshots.
You don’t have any global overrides set, so that’s not the issue.
Do you have a specific language (syntax highlighter) enabled right now? The lower-left corner of the status bar says things like
Normal text fileor
Hyper Text Markup Language fileor
User Defined language file - Markdown (preinstalled), or you can look in the Language menu for which has the
⚫dot showing it’s active
Example Status Bar Example Language Menu
If there is a syntax highlighter active, then you will need to look in Style Configurator settings for that Language (that is, click that language in the Language chooser box on the left of the style configurator dialog).
If no syntax highlighter language is selected (that is,
Normal text fileor Language > ⚫ None (Normal text)), then looking in the syntax highlighter at Language: Global Styles > Style: Default Style will show if maybe something got changed in your theme compared to the default.
If you have a user defined language active – the status bar will have
User Defined language file - XXXX(where XXX is like the
Markdown (preinstalled)that I mentioned above, and the Language menu will have the
⚫near one of the ones near the bottom:
With a UDL , but a theme of
Dark Mode Defaultlike you showed, then the coloring will be like you showed:
This is because the User Defined Languages do not change when you change the theme. The UDL system is mostly independent of theme (except it inherits the theme’s Global Styles settings – though most of the Global Styles > Default Style settings are overridden by the UDL’s Language > User Defined Language > Define Your Language’s Default Style: Styler settings).
Given that my
Markdown (preinstalled)UDL screenshot seems to match your screenshot, I strongly believe that’s what language you have active, and thus I will work an example of how to edit your
Markdown (preinstalled)UDL to match Dark Mode Default theme.
UDL example conflict:
Dark Mode Defaulttheme uses Default Style with FG=grey(220,220,204) BG=dark grey(63,63,63), and Selected Text Colour style with BG=(88,88,88) and Current Line Background style with BG=(16,16,16).
In conflict with this, the
Markdown (preinstalled)UDL has a Default style with FG=(51,51,51) and BG=white(255,255,255) – which seems to match your screenshot that has dark text with light behind it, but the main background is still the theme’s background. If I change FG=(220,220,204) and BG=(63,63,63), now the main text in the Markdown UDL matches. (You click on the color box, then More Colours… and then can manually set the Red, Green, and Blue values and click OK)
You will probably want to make the stylers for the UDL’s other settings (Keyword lists, Comment & Number, Operators & Delimiters) to also be compatible, with proper contrast to your dark theme. You can see what other built-in languages’ settings use for keywords and comments and numbers in the Dark Mode Default theme, and use those for the UDL as well.
TL;DR / Summary
If you have a User Defined Language (UDL) selected, it does not follow the theme, because UDL is a separate system from built-in lexer themes. But the theme still defines things like the main background color for areas in the text editor that have no text (like to the right of the last character on a line). As such, the theme and the UDL can conflict. You must edit a UDL’s styler to match the current theme.
Please note: this has always been true of themes vs. UDL, so if you had selected a darker theme (like
Bespin) even in versions before Dark Mode was available, even then, you had to edit your UDL to match your favorite theme.
Hi Peter, thank you very much for all this effort to help me. You succeeded, I found why it looked like that.
I use this program for years as a better replacement for the Microsoft Windows Notepad. In the past I did some HTML work with the BBC code and it was set to that language. I never noticed the normal text setting until now.
So I set it to normal text and everything looks like it should.
Problem solved, so again thank you for the effort.