Recent update changes language colors
-
Hi! I use Notepad++ to edit JSON, and have been for years. I recently updated to 7.8.5, and it changed all the default colors for my JSON text. I’ve never touched these, and I don’t know why it would do this. I can confirm it’s this updating process, as installing an older version uses the normal colors and updating that uses the newer colors. Is there any way I can prevent this from happening?
-
Did some more installing of older versions, seems the change happens from 7.8.2 to 7.8.3. I can’t find any differences in the Style Preferences that would affect this (I looked in General and JSON).
-
Upgrade, remove langs.xml and start npp should do the trick.
-
Yes, there appears to have been a change in the JSON styling between v7.8.2 and v7.8.3. Verifying with fresh unzip of portable(zip) editions:
v7.8.2
v7.8.3
deltas
langs.xml
changed in the JSON from v7.8.2 (left) to v7.8.3 (right):
stylers.xml
also changed in the JSON from v7.8.2 (left) to v7.8.3 (right):
Looking at the release notes at https://notepad-plus-plus.org/downloads/v7.8.3/ , it specifically says “3. Improve Json syntax highlighting.”
And personally, I agree, the changes were an improvement – it distinguishes between the name and the value, even if they are both strings, and has a lot more granularity of what can and cannot be styled.
As @Ekopalypse said, however, if you previously had a normal install the
langs.xml
and/orstylers.xml
for v7.8.2 or earlier version in your%AppData%\Notepad++
folder, and upgraded to v7.8.3 or newer, then the StyleID’s won’t match the lexer, so colors may be applied to the wrong tokens, and you won’t have the full customizability that is built into the lexer; follow his steps forstylers.xml
andlangs.xml
to refresh those to the newest values.However, if you delete and auto-regenerate
stylers.xml
, any other languages’ customization will also be lost. Instead of deleting, you might want to renamestylers.xml
toold.stylers.xml
, then use the Compare plugin to compare theold.stylers.xml
to the regeneratedstylers.xml
, and then copy over any customizations into the regenerated file. -
Peter says it all, but maybe also of relevance:
-
Alright, thanks for your help everyone! Deleting the langs.xml file fixed it.