My Notepad++ can't read style correctly

  • There’s several style in the stylers.model.xml file, but in the Style Configurator there’s just a few options for setting and when I open a file, the color style is not what that look like on other computer. (forgive my poor English, my native language is not English)

  • @Huanying04 ,

    Your JSON is showing as styled, so Notepad++ is properly behaving as designed, and styling the JSON correctly.

    However, I think what you’re commenting on is that stylers.model.xml lists 14 different styles, but your Style Configurator only shows 6.

    That’s because a default installation of Notepad++ uses %AppData%\Notepad++\stylers.xml as the Style Configurator config file. The stylers.model.xml you found in the Notepad++ program directory is what Notepad++ uses to re-create %AppData%\Notepad++\stylers.xml if there isn’t one found. So, my guess is that you’ve updated Notepad++ on this computer, so that its stylers.model.xml is newer than your %AppData%\Notepad++\stylers.xml. If you opened %AppData%\Notepad++\stylers.xml (File | Open, and paste that string in), I believe it would only show the 6 styles that you can see.

    To fix this, you have two options:

    1. Delete and Re-create stylers.xml:
      • WARNING: if you had customized any of your colors in the style configurator, this method will delete those customizations and you will have to redo them. I do not recommend this method if you want to keep your custom colors; try method#2 instead.
      1. Close all open Notepad++ windows
      2. Go to %AppData%\Notepad++\ and delete the stylers.xml file
      3. Open Notepad++. It will re-create %AppData%\Notepad++\stylers.xml
      4. Style Configurator > JSON should show all 14 styles now.
    2. Manually merge the two
      • WARNING: Do not change any Notepad++ settings until after step #6.
      1. Close all open Notepad++ windows.
      2. Open a single Notepad++ window.
      3. Open the files stylers.model.xml in one view, and %AppData%\Notepad++\stylers.xml in the other
      4. If you have the Compare plugin, you can compare the two files to find where differences are; otherwise, you can just manually compare the two, and copy rows from stylers.model.xml to stylers.xml that were missing in stylers.xml.
      5. Close Notepad++ without changing any other settings
      6. Open Notepad++.
      7. Style Configurator > JSON should show all 14 styles now.

    PS: For more on %AppData%\Notepad++ folder, see "FAQ Desk: What is %AppData%"

Log in to reply