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).
Ekopalypse last edited by
Upgrade, remove langs.xml and start npp should do the trick.
PeterJones last edited by
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:
langs.xmlchanged in the JSON from v7.8.2 (left) to v7.8.3 (right):
stylers.xmlalso 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
stylers.xmlfor 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 for
langs.xmlto 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 rename
old.stylers.xml, then use the Compare plugin to compare the
old.stylers.xmlto the regenerated
stylers.xml, and then copy over any customizations into the regenerated file.
Alan Kilborn last edited by
Peter says it all, but maybe also of relevance:
Alright, thanks for your help everyone! Deleting the langs.xml file fixed it.