Community
    • Login

    Windows .reg recognized, but no syntax highlighting? (2)

    Scheduled Pinned Locked Moved General Discussion
    7 Posts 4 Posters 619 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.
    • Laurie StearnL
      Laurie Stearn
      last edited by PeterJones

      As the four year old original topic
      topic/17437/windows-reg-recognized-but-no-syntax-highlighting is understandably locked, just a note to confirm the issue.
      WhereIsReg.png
      Opening a .reg file for the first time did get syntax highlighting which resembled CSS a bit, although it did not present clearly in a dark theme, changing it to another language and then back to Registry ended up with no or “none” highlighting.
      Did try ytdlder’s method to return the Registry item to the list, no dice unfortunately.
      In Stylers.xml there is a language “Register”, no “Registry” - would that be the cause?

      Terry RT rdipardoR 2 Replies Last reply Reply Quote 1
      • Terry RT
        Terry R @Laurie Stearn
        last edited by Terry R

        @Laurie-Stearn said in Windows .reg recognized, but no syntax highlighting? (2):

        In Stylers.xml there is a language “Register”, no “Registry” - would that be the cause?

        Possibly. In my stylers.xml file (looking thru the GUI) I see
        23e3a974-5144-4594-ad27-267970e3ba8c-image.png

        When I open the stylers.xml file (from %appdata%\Notepad++ folder) I see a lexer which references this line. Note it has no extension as I didn’t have a “user ext.” added.

        Quite possibly you have a corruption in this file at this location. If you look at the same file in the installed folder (where Notepad++ resides), so either “Program Files” or “Program Files x86” you might see the content referring to the “registry”. If so then consider copying this file over top of the one in the %appdata%\Notepad++ folder. Bear in mind that any alterations you have done in the style configurator will be lost, so the other option will be to copy just the relevant lines from the good stylers.xml file to the bad file.

        Terry

        PS I should also ask, are you using the most current version of NOtepad++, or an old one.

        Laurie StearnL 1 Reply Last reply Reply Quote 1
        • rdipardoR
          rdipardo @Laurie Stearn
          last edited by

          @Laurie-Stearn said in [Windows .reg recognized, but no syntax

          Opening a .reg file for the first time did get syntax highlighting which resembled CSS a bit, although it did not present clearly in a dark theme

          Highlighting will appear only if the active theme has assigned styles to the particular file type. At the moment, only 3 themes assign styles to Registry, not counting “Default (stylers.xml)” :

          $ git grep -li 'name="registry"' -- PowerEditor/installer/themes | awk -F '/' '{print $4}'
          DarkModeDefault.xml
          Deep Black.xml
          Zenburn.xml
          

          So, you will have to choose “DarkModeDefault”, “Deep Black” or “Zenburn” to get styling in Registry files. Or try a third-party theme that covers a wider range of file types, e.g.,

          npp-coral-reef-reg.png

          PeterJonesP 1 Reply Last reply Reply Quote 2
          • Laurie StearnL
            Laurie Stearn @Terry R
            last edited by

            Terry-R: Using recent version 8.5.8.
            The Stylers.xml in Appdata is dated 26/01/2023. Using the cloud, so it’s the same. The langs.xml file is dated 2016 - same with you?
            Also, no REBOL language in there either, mine must be old,

            rdipardo: Thanks for the heads up, will keep that in mind.

            Ehm, something isn’t working, there are files stylers.model.xml, langs.model.xml and contextMenu.xml in Program Files all looking larger and newer than the ones above. This may be related to installing N++ during a network connection issue, is it possible just to install over the current with same? Alternatively, just manually remove the model extension, and copy/replace existing old files?

            If there is something borked in the setup, it might explain the absence of Edit with Notepad++ (Admin) on the context menu.
            This all worked on W10, anyhow there’s a related question at github:

            notepad-plus-plus/issues/13410#issuecomment-1787024809

            PeterJonesP 1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @rdipardo
              last edited by

              @rdipardo said in Windows .reg recognized, but no syntax highlighting? (2):

              Or try a third-party theme that covers a wider range of file types

              You have a third-party theme that you haven’t shared in the Notepad++ Themes Collection? Shame on you. ;-)

              1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Laurie Stearn
                last edited by

                @Laurie-Stearn said in Windows .reg recognized, but no syntax highlighting? (2):

                The langs.xml file is dated 2016 - same with you?

                Your langs.xml is 7 years out of date.

                there are files stylers.model.xml, langs.model.xml and contextMenu.xml in Program Files all looking larger and newer than the ones above

                Correct, the installer does not update your copies of the non-model files, because it might delete customizations you’ve made, which would annoy users who have customized.

                If you haven’t customized any of your stylers, language keywords, or context menu, then you can safely delete the versions in %AppData%\Notepad++ and the next time you run Notepad++ it will re-create those files from their defaults.

                If you have customized those, then I would suggest using the ComparePlus plugin to compare %AppData%\Notepad++\____.xml to C:\Program Files\Notepad++\___.model.xml, and bring across anything from the .model.xml that doesn’t clobber your customizations.

                Laurie StearnL 1 Reply Last reply Reply Quote 3
                • Laurie StearnL
                  Laurie Stearn @PeterJones
                  last edited by Laurie Stearn

                  @PeterJones :
                  Bit late to get back in order to say thank you muchly, “Registry” language looks great now.
                  Quite a few /corrections changes in Langs and Stylers since 2014, PREPROCESSOR is now omitted for Java, and DIRECTIVE, DIRECTIVE OPERAND for VHDL, heck never used those. As for the changes in GlobalStyles in missing out on the pleasures of Bookmark margin, Change History margin, Document map, EOL custom color and Non-printing characters custom color, good to have them in!

                  (Note to self for next time: On a manual copy only worry about the GlobalStyles in Stylers as running a weird darkish theme under “Light Mode” where the styling for ini, reg, XML CSS and the like is easy on the eye albeit a little dark.)

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