Community
    • Login

    Config Files Need Updating, Too

    Scheduled Pinned Locked Moved General Discussion
    pythonscriptconfig-filesstylers.xmllangs.xmlsyntax highlight
    37 Posts 7 Posters 3.7k 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.
    • CoisesC
      Coises @Lycan Thrope
      last edited by Coises

      @Lycan-Thrope said in Config Files Need Updating, Too:

      @PeterJones ,
      Report is in the Github post I just made, but the apparent problem was two off-book plugins I had tested and was playing with which are:

      ControlledAutoIndent (1)
      WebEdit (2.7)

      I am on Windows 10. With my ControlledAutoIndent plugin installed (even when Enabled is not checked — in which state it should be doing nothing), I get the same result as @Lycan-Thrope.

      When I removed it and tried again, I got through the first phase and encountered the request to restart. After answering OK, waiting for relaunch and then selecting Update Config Files again, a bunch of activity occurred, and then this came up:

      efddd411-cff6-4ae8-a876-c24c9c809f47-image.png

      This much is reproducible. I will try to investigate further. Debug info (captured before running first phase without ControlledAutoIndent):

      Notepad++ v8.8.1   (64-bit)
      Build time : May  3 2025 - 18:41:09
      Scintilla/Lexilla included : 5.5.6/5.4.4
      Boost Regex included : 1_85
      Path : C:\Program Files\Notepad++\notepad++.exe
      Command Line : 
      Admin mode : OFF
      Local Conf mode : OFF
      Cloud Config : OFF
      Periodic Backup : OFF
      Placeholders : OFF
      Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITE (1)
      Multi-instance Mode : monoInst
      File Status Auto-Detection : cdEnabledNew (for current file/tab only)
      Dark Mode : OFF
      OS Name : Windows 10 Pro (64-bit)
      OS Version : 22H2
      OS Build : 19045.5737
      Current ANSI codepage : 1252
      Plugins : 
          ColumnsPlusPlus (1.2)
          ComparePlus (1.2)
          ConfigUpdater (2)
          DSpellCheck (1.5)
          mimeTools (3.1)
          NppConverter (4.6)
          NppExport (0.4)
      

      Edit to add: I continue to get the Access Violation in the second phase even after removing all plugins except ConfigUpdater. I will continue to search for the causes of both errors.

      Edit to add 2: The problem with ControlledAutoIndent was entirely due to a mistake in that plugin. It’s not even a “conflict,” just a straight-up error. I had no idea what would cause an “External Lexer” to be used. (The plugin keeps track of the current language so it knows what indentation rules to apply.) I made a silly mistake in the code that handles the External Lexer case, and just never hit it until now.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • CoisesC
        Coises
        last edited by

        @PeterJones

        I can give you this much concerning the apparent cause of the access violation:

        97895b1a-c895-4fc3-907c-071f55364dcb-image.png

        but I don’t know what to check to determine what might be leading to this condition. Quite possibly I have some very old version of one of these files, because as best I can remember, I have never manually edited any of them except (I think) shortcuts, and I’ve never bothered to try to upgrade them outside whatever the Notepad++ installer does.

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

          @Coises ,

          Edit to add 2: The problem with ControlledAutoIndent was entirely due to a mistake in that plugin. It’s not even a “conflict,” just a straight-up error. I had no idea what would cause an “External Lexer” to be used. (The plugin keeps track of the current language so it knows what indentation rules to apply.) I made a silly mistake in the code that handles the External Lexer case, and just never hit it until now.

          I’m not sure why the ConfigUpdater plugin would trigger your plugin to think there was an External Lexer (it is not a lexer plugin, after all)… but I’m glad you found that one.

          Edit to add: I continue to get the Access Violation in the second phase even after removing all plugins except ConfigUpdater. I will continue to search for the causes of both errors.

          Access Violation implies that there’s a null pointer someplace. I thought I’d fixed that for all the styler/themes, but with langs.xml being the last message in the status, maybe I didn’t check properly in the langs-updater. I’ll go take a look. (However, my normal debug in Win11 and my VM+Win10 tests all worked just fine for both themes and langs, so I still cannot reproduce the problem that’s causing that, so even if I find something, I’ll have to rely on you to test if I’ve actually fixed it.

          While I am looking, could you try to do CANCEL instead of YES, and see if you still get the Access Violation at langs.xml when you are not running in Admin mode?

          update 1: I see you posted a reply just before my post: thank you for that Call Stack: I will start my search at line 1077. :-)

          update 2: could you go to the issues page and create a new issue (this Access Violation is separate from the freeze/crash, I think), and attach your langs.xml to the issue? Maybe with that file, I’d be able to reproduce the problem.

          CoisesC 1 Reply Last reply Reply Quote 0
          • CoisesC
            Coises @PeterJones
            last edited by

            @PeterJones said in Config Files Need Updating, Too:

            I’m not sure why the ConfigUpdater plugin would trigger your plugin to think there was an External Lexer (it is not a lexer plugin, after all)… but I’m glad you found that one.

            Apparently ErrorList is an external lexer, and ControlledAutoIndent is picking that up as the active language at some point.

            While I am looking, could you try to do CANCEL instead of YES, and see if you still get the Access Violation at langs.xml when you are not running in Admin mode?

            Same result (at least, superficially). However, I realize now that the switch to Admin mode was not happening when running under the debugger; the call stack I posted was happening with Notepad++ not in Admin mode. I don’t know if there is a way I can trap an error in the debugger while running with elevated permissions.

            update 2: could you go to the issues page and create a new issue (this Access Violation is separate from the freeze/crash, I think), and attach your langs.xml to the issue? Maybe with that file, I’d be able to reproduce the problem.

            I will do that shortly.

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

              @Coises said in Config Files Need Updating, Too:

              Apparently ErrorList is an external lexer, and ControlledAutoIndent is picking that up as the active language at some point.

              I guarantee it is not: it is a standard Lexilla lexer. Did you update your menuCmdID.h file which defines the external lexer constants?
              6290b5a8-1ad5-4057-9a01-92c03ffbcd1d-image.png
              …
              No, it doesn’t look like you have:
              76951d68-3a7d-4c0b-913e-34e063d02ee3-image.png

              But since it’s IDM_LANG+93 vs IDM_LANG+165, and you shouldn’t be looking at the IDM, that’s not the likely culprit (though something you should still fix)

              Ah, searching for external in your plugin:
              de271d0f-db2f-4fb6-9ea5-db8307aaef19-image.png
              it’s using the L_xxxx enumeration values from the Notepad_plus_msgs.h::LangType enumeration

              And that makes sense: Don chose to use whatever the “last” enumeration value happens to be for L_EXTERNAL, which means that every time a new built-in language is added, all plugin authors who compare vs L_EXTERNAL must update Notepad_plus_msgs.h whenever N++ does, otherwise their comparison will be off for anyone using one of the newer lexers in the most recent N++.

              So definitely update menuCmdID.h and Notepad_plus_msgs.h, and then that comparison should not be true, and it won’t go into that section of code erroneously.

              CoisesC 1 Reply Last reply Reply Quote 0
              • CoisesC
                Coises @PeterJones
                last edited by

                @PeterJones said in Config Files Need Updating, Too:

                it’s using the L_xxxx enumeration

                Thank you. It appears (since of course updates could always happen without a plugin being updated) that I’ll need to find a way to determine what is an external lexer at run time (not just what would have been an external lexer when I compiled the plugin).

                Lycan ThropeL 1 Reply Last reply Reply Quote 0
                • Lycan ThropeL
                  Lycan Thrope @Coises
                  last edited by

                  @Coises ,
                  Glad you guys figured it out. I was really tired when testing this, and realized after I signed off and shut down the computer that I had already tested without WebTools, before I got impatient and removed all the plugins, since I started from the bottom alphabetically and was working to the top.

                  So the problem that was happening for me, was probably just the AutoIndent plugin, and I say probably because I can’t be sure the combo of it with another, possibly WebTools, couldn’t have been the culprit. I’d been up close to 21 hours when I shutdown and couldn’t force myself to sign back on. :-(

                  CoisesC 1 Reply Last reply Reply Quote 0
                  • PeterJonesP
                    PeterJones
                    last edited by

                    v2.0.1, with bugfix for @Coises “Access Violation” is released on GitHub. I have “paused” my nppPluginList submission, but will most likely submit 2.0.1 to the plugin list tomorrow, unless something else is discovered.

                    For those who want details:

                    Bugfix: Fix an “Access Violation” that occurs with specific condition of old langs.xml vs new langs.model.xml – when the model had <Language name="blah"><Keywords ...></Language> but the old langs.xml only had empty <Language name="blah"/>, it would cause the plugin to crash. The logic has been fixed so it properly copies over the new <Keywords ...> into the previously-empty <Language> element.
                    1 Reply Last reply Reply Quote 2
                    • CoisesC
                      Coises @Lycan Thrope
                      last edited by

                      @Lycan-Thrope said in Config Files Need Updating, Too:

                      So the problem that was happening for me, was probably just the AutoIndent plugin, and I say probably because I can’t be sure the combo of it with another, possibly WebTools, couldn’t have been the culprit.

                      For what it’s worth, as the author of Controlled Auto-indent, I can guarantee it was the culprit. It could crash under other circumstances, too, having nothing to do with ConfigUpdater; I just hadn’t hit one of them, and if anyone else did before you, they didn’t report it.

                      A fixed version exists now.

                      Lycan ThropeL 1 Reply Last reply Reply Quote 1
                      • Lycan ThropeL
                        Lycan Thrope @Coises
                        last edited by Lycan Thrope

                        @Coises said in Config Files Need Updating, Too:

                        For what it’s worth, as the author of Controlled Auto-indent, I can guarantee it was the culprit. It could crash under other circumstances, too, having nothing to do with ConfigUpdater; I just hadn’t hit one of them, and if anyone else did before you, they didn’t report it.

                        I appreciate that, and I’ll go ahead and download it and test it against the old and new versions of ConfigUpdater. I’ve already downloaded, but not installed the new version of CU yet.

                        Update: It works fine under the old CU and the new CU. I tried it with CAI enabled and not enabled, and the CU ran through everything, so the crash condition from CAI appears to be gone. Glad I could help find that edge case, unknowingly. :-)

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