Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Login

    First menu item unexpectedly being called on startup

    Notepad++ & Plugin Development
    3
    6
    88
    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.
    • ThosRTannerT
      ThosRTanner
      last edited by

      I’ve been playing around with https://github.com/deadem/notepad-pp-linter and discovered something odd has started happening (using notepad++ 8.5.6).

      When I start notepad++ it behaves as though I’ve clicked the first menu entry for the plugin (which calls editConfig here https://github.com/deadem/notepad-pp-linter/blob/49586fd72d54bd068fc5e8b0d085b6bac360c3e1/plugin.cpp#L93 which opens the configuration file).

      I have experimented a bit. It is ONLY the first menu entry - if I add a second one, it doesn’t get called. If I swap the order, the new first one gets called, and the 2nd one (editConfig) doesn’t get called.

      Is this something that started in 8.5.6? Or is there some variable that I’m not initialising properly and is therefore doing different things at different times? Or A.N.Other thing?

      1 Reply Last reply Reply Quote 0
      • Thomas KnoefelT
        Thomas Knoefel
        last edited by Thomas Knoefel

        Can you show us the code for how you add the second menu entry? In the code you provided, only one entry is visible.

        I assume you add the second menu entry like this with 1:

        setCommand(0, TEXT("&FirstMenuPoint"), firstFunction, NULL, false);
        setCommand(1, TEXT("&SecondMenuPoint"), secondFunction, NULL, false);
        
        ThosRTannerT 1 Reply Last reply Reply Quote 0
        • ThosRTannerT
          ThosRTanner @Thomas Knoefel
          last edited by

          @Thomas-Knoefel

          I tried both

          setCommand(0, TEXT("&FirstMenuPoint"), firstFunction, NULL, false);
          setCommand(1, TEXT("&SecondMenuPoint"), secondFunction, NULL, false);
          

          and

          setCommand(0, TEXT("&SecondMenuPoint"), secondFunction, NULL, false);
          setCommand(1, TEXT("&FirstMenuPoint"), firstFunction, NULL, false);
          

          In both cases, command entry 0 gets called before notepad++ has displayed any windows

          Thomas KnoefelT 2 Replies Last reply Reply Quote 0
          • Thomas KnoefelT
            Thomas Knoefel @ThosRTanner
            last edited by Thomas Knoefel

            @ThosRTanner I’ve tested ‘Linter’ with my N++ installation, and I didn’t experience this issue: no window opened before the main N++ window. I can only offer some suggestions. Have you tried deleting the N++ config.xml?
            Additionally, I would suggest updating to the 8.5.7 version.

            R 1 Reply Last reply Reply Quote 1
            • Thomas KnoefelT
              Thomas Knoefel @ThosRTanner
              last edited by Thomas Knoefel

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • R
                rdipardo @Thomas Knoefel
                last edited by

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