• Login
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.
  • S
    supasillyass
    last edited by Aug 18, 2019, 12:36 PM

    I’ve noticed some strange entries appearing in the theme XML files, such as:

    <WordsStyle name="COMMENTLINE" ... >ContentScroller</WordsStyle>
    <WordsStyle name="INSTRUCTION WORD" ... >ooooo</WordsStyle>
    <WordsStyle name="NUMBER" ... >endfunction endif</WordsStyle>
    <WordsStyle name="NUMBER" ... >if else for while</WordsStyle>
    <WordsStyle name="NUMBER" ... >import</WordsStyle>
    <WordsStyle name="STRING RIGHT QUOTE" ... >onMotionChanged onMotionFinished Tween ImagesStrip ContentScroller mx transitions easing Sprite Point MouseEvent Event BitmapData Timer TimerEvent addEventListener event x y height width</WordsStyle>
    

    Are these expected or is it a bug?

    E 1 Reply Last reply Aug 18, 2019, 7:56 PM Reply Quote 1
    • E
      Ekopalypse @supasillyass
      last edited by Aug 18, 2019, 7:56 PM

      @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
      • S
        supasillyass
        last edited by Aug 18, 2019, 8:21 PM

        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 
        
        E 1 Reply Last reply Aug 18, 2019, 9:19 PM Reply Quote 2
        • E
          Ekopalypse @supasillyass
          last edited by Aug 18, 2019, 9:19 PM

          @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.
          S 1 Reply Last reply Aug 18, 2019, 9:35 PM Reply Quote 1
          • S
            supasillyass @Ekopalypse
            last edited by Aug 18, 2019, 9:35 PM

            @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).

            E 1 Reply Last reply Aug 18, 2019, 9:37 PM Reply Quote 0
            • E
              Ekopalypse @supasillyass
              last edited by Aug 18, 2019, 9:37 PM

              @supasillyass

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

              S 1 Reply Last reply Aug 18, 2019, 9:51 PM Reply Quote 1
              • S
                supasillyass @Ekopalypse
                last edited by Aug 18, 2019, 9:51 PM

                @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>
                
                E 2 Replies Last reply Aug 18, 2019, 9:59 PM Reply Quote 0
                • E
                  Ekopalypse @supasillyass
                  last edited by Aug 18, 2019, 9:59 PM

                  @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
                  • E
                    Ekopalypse @supasillyass
                    last edited by Aug 18, 2019, 10:23 PM

                    @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.

                    S 1 Reply Last reply Aug 18, 2019, 11:14 PM Reply Quote 1
                    • S
                      supasillyass @Ekopalypse
                      last edited by Aug 18, 2019, 11:14 PM

                      @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.)

                      E 1 Reply Last reply Aug 18, 2019, 11:32 PM Reply Quote 0
                      • S
                        supasillyass
                        last edited by Aug 18, 2019, 11:22 PM

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

                        1 Reply Last reply Reply Quote 1
                        • E
                          Ekopalypse @supasillyass
                          last edited by Aug 18, 2019, 11:32 PM

                          @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
                          • S
                            supasillyass
                            last edited by supasillyass Aug 19, 2019, 2:08 PM Aug 19, 2019, 2:06 PM

                            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
                            • E
                              Ekopalypse
                              last edited by Aug 19, 2019, 2:18 PM

                              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
                              • S
                                supasillyass
                                last edited by Aug 21, 2019, 8:46 PM

                                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
                                9 out of 15
                                • First post
                                  9/15
                                  Last post
                                The Community of users of the Notepad++ text editor.
                                Powered by NodeBB | Contributors