I very much like NP++ ability to show a different background for code in different languages.
Can anybody help me with that, please. Thank you.
Ricardo E. Trelles 0 last edited by Ricardo E. Trelles 0
@Ricardo-E-Trelles-0 Switched to ver. 7.8.6
Ekopalypse last edited by
Your second post made me believe you’ve solved your problem but this doesn’t seem to be the case. I’m still confused about what works and what not,
so I would suggest you post a picture about to explain it.
Posting a picture is as easy as with normal copy and paste operations. And post your debug info from the ? menu, the last menu item.
@Ekopalypse Thank you very for your attention!
Yes, my second post could be interpreted as that I had solved the problem, but I hasn’t.
Funny thing is that for PHP both embedded code and regular files look fine, with their background color filling everything.
I hope you understand the description of the problem above or can see the difference JS/PHP in the capture included. I emphasized the blue in JS to make it more noticeable in this sample.
What do you think?
Ekopalypse last edited by
So do I understand correctly if I say you want to have a different theme
based on the programming language used?
Like for example this
However, in embedded JS background fills everything between “<script>” and “</script>”.
Now you see what is happening?
JS-PHP-backcolor-2.jpg ing in the newer versions?
By default, they manually set every background to RGB=(242,244,255)
If I change one of them to orange, it works as expected.:
.jscharacters will have a background of yellow, except empty space and unused characters, because that background is set by the theme’s
GlobalStyle > DEFAULTstyle.
<script>section and the non-
PHP files are shown with all background filled uniform (right of that same first picture). Why JS files would be different?
Sorry, I already said, “except empty space and unused characters, because that background is set by the theme’s
GlobalStyle > DEFAULTstyle.”. The main background for a theme (whitespace and empty space) is set by the theme’s
GlobalStyle > DEFAULT, not by any language-specific settings. So you cannot do what you have asked.
The whole point of the
GlobalStyle > DEFAULTstyle is that it is the style that sets the background color for empty space, not any language-specific setting. That is core to the design of the syntax highlighter in Notepad++.
PHP files are shown with all background filled uniform (right of that same first picture).
Oh, I see your confusion now. It’s because they aren’t shown with “all background filled uniform”. You just think they do because all of your PHP syntax occurs within the
?>pseudo-tag. Anything outside that tag does not get that background color, even though it’s not part of the same file.
GlobalStyle > DEFAULTsetting the background color for the whole document, and every other per-language style only making minor exceptions to that default. Personally, I would vote for PHP’s syntax highlighter to not violate that principle, and instead I think that PHP shouldn’t take over empty-space backgrounds.
OK. So you prefer the look of JS (left) to PHP (right) in my first picture. I only hope they don’t make my PHP code look like the JS there. If so, I would have to revert to version 5.1, where JS files, no being embedded, have a clean uniform background and look the same to the embedded one.
Thank you. You made me know that problem (for my taste) isn’t a mistake, it’s a “feature”.
If you don’t like the background, change the default background. I’ve pointed you to the setting multiple times.