Community
    • Login

    Theme XML files getting borked?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    settingsxmlbugthemestyle
    15 Posts 2 Posters 5.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EkopalypseE
      Ekopalypse @supasillyass
      last edited by

      @supasillyass

      In which file did you see this?
      Can you post your debug-info, which is available from ? menu, the last menu item?

      1 Reply Last reply Reply Quote 0
      • supasillyassS
        supasillyass
        last edited by

        Most of the %APPDATA%\Notepad++\themes\*.xml files. It seems to be caused by using the Style Configurator to save changes.

        Debug Info:

        Notepad++ v7.7.1   (32-bit)
        Build time : Jun 16 2019 - 21:14:50
        Path : C:\Program Files (x86)\Notepad++\notepad++.exe
        Admin mode : OFF
        Local Conf mode : OFF
        OS : Windows 7 (64-bit)
        Plugins : ColorPicker.dll ComparePlugin.dll DSpellCheck.dll HexEditor.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppCalc.dll NppConverter.dll NppExport.dll NPPJSONViewer.dll NppQCP.dll NppSaveAsAdmin.dll NppTextFX.dll XMLTools.dll _CustomizeToolbar.dll 
        
        EkopalypseE 1 Reply Last reply Reply Quote 2
        • EkopalypseE
          Ekopalypse @supasillyass
          last edited by

          @supasillyass

          I would give the following a try

          1. stop npp
          2. temporarily rename %APPDATA%\Notepad++
          3. restart npp
          4. check that %APPDATA%\Notepad++ and sub-directories do get recreated and redo
            you tests.
          supasillyassS 1 Reply Last reply Reply Quote 1
          • supasillyassS
            supasillyass @Ekopalypse
            last edited by

            @Ekopalypse said:

            @supasillyass

            I would give the following a try

            1. stop npp
            2. temporarily rename %APPDATA%\Notepad++
            3. restart npp
            4. check that %APPDATA%\Notepad++ and sub-directories do get recreated and redo
              you tests.

            The themes folder doesn’t get recreated, leaving just the default theme (stylers.xml).

            EkopalypseE 1 Reply Last reply Reply Quote 0
            • EkopalypseE
              Ekopalypse @supasillyass
              last edited by

              @supasillyass

              copy it over from C:\Program Files (x86)\Notepad++

              supasillyassS 1 Reply Last reply Reply Quote 1
              • supasillyassS
                supasillyass @Ekopalypse
                last edited by

                @Ekopalypse said:

                @supasillyass

                copy it over from C:\Program Files (x86)\Notepad++

                It’s not there. I’m guessing it gets created at installation. I did, however, try it with the portable version and it does occur:

                <LexerType name="actionscript" desc="ActionScript" ext="">
                    <WordsStyle name="TYPE WORD" ... >onMotionChanged onMotionFinished Tween ImagesStrip ContentScroller mx transitions easing Sprite Point MouseEvent Event BitmapData Timer TimerEvent addEventListener event x y height width</WordsStyle>
                
                EkopalypseE 2 Replies Last reply Reply Quote 0
                • EkopalypseE
                  Ekopalypse @supasillyass
                  last edited by

                  @supasillyass

                  that is correct if one specified user defined keywords in an keyword tag like
                  in actionscript the “TYPE WORD” is but “COMMENTLINE” is not and
                  I don’t have any additional word in any of my themes.xml in any of the “COMMENTLINE” tags.

                  1 Reply Last reply Reply Quote 0
                  • EkopalypseE
                    Ekopalypse @supasillyass
                    last edited by

                    @supasillyass

                    Ok, in addition to the known fact that the themes are not up to date with the default style
                    some of them seem to have invalid data, meaning having string content in non-keyword tokens.
                    I do have a FR which, when gets accepted, could be used to cleanup those data as well.

                    supasillyassS 1 Reply Last reply Reply Quote 1
                    • supasillyassS
                      supasillyass @Ekopalypse
                      last edited by

                      @Ekopalypse said:

                      @supasillyass

                      Ok, in addition to the known fact that the themes are not up to date with the default style
                      some of them seem to have invalid data, meaning having string content in non-keyword tokens.

                      I do have a FR which, when gets accepted, could be used to cleanup those data as well.

                      I think this might be the source of the problem, with the invalid data getting propagated across to the different styles. (If I clean up one style XML file directly, the invalid data creeps back in after playing around with the Style Configurator.)

                      EkopalypseE 1 Reply Last reply Reply Quote 0
                      • supasillyassS
                        supasillyass
                        last edited by

                        Edit: Bespin.xml, Choco.xml and HotFudgeSundae.xml might be the worst offenders.

                        1 Reply Last reply Reply Quote 1
                        • EkopalypseE
                          Ekopalypse @supasillyass
                          last edited by

                          @supasillyass

                          Haven’t verified the source code but from what you are telling I assume that npp loads it
                          on startup and keeps it in memory, meaning, when you stop npp and edit the xml with a
                          different editor it might not get repopulated.

                          1 Reply Last reply Reply Quote 1
                          • supasillyassS
                            supasillyass
                            last edited by supasillyass

                            I tried sanitising the theme files by getting the default set from portable Notepad++ and using grepWin to replace ">.*<\/WordsStyle>" with " \/>". However, the files still get borked because the LexerTypes vary between the themes (ordering also seems to matter). So, when I changed from Obsidian to Black board, my bash and Batch keywords got transferred to TCL and Objective-C (QUALIFIER not INSTRUCTION WORD).

                            1 Reply Last reply Reply Quote 0
                            • EkopalypseE
                              Ekopalypse
                              last edited by

                              Yes, as I’ve mentioned in this FR themes and default style aren’t in sync. So an automate way must
                              read the default xml and compare tags against the theme files and act accordingly.
                              Unfortunately @donho hadn’t time to have a look or maybe he has something different in mind, like changing the way themes are currently used.

                              1 Reply Last reply Reply Quote 3
                              • supasillyassS
                                supasillyass
                                last edited by

                                A kludgy fix is to make the theme XML files read-only and add new keywords directly to langs.xml, using a different text editor. (My langs.xml was pretty old, so I grabbed langs.model.xml from the latest portable version.)

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                The Community of users of the Notepad++ text editor.
                                Powered by NodeBB | Contributors