Community
    • Login

    np++ 64bit - max number of tabs

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 4 Posters 3.5k 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.
    • sign-in-smthS
      sign-in-smth
      last edited by

      i often need to edit (search/replace mostly) a lot of .rpy game files simultaneously, sometimes up to a few hundred files in one game. when i use Edit with NP++ after selecting all of them from windows explorer context menu, when theres a lot of files, np++ spreads them over a few instances of it, like today for ~560 files it opened 6 instances of itself. i want all files to open in a single instance of np++ so i dont have to do same replace operation in each instance. how do i force it to always use 1 instance no matter how many files?

      Scott SumnerS 1 Reply Last reply Reply Quote 2
      • Scott SumnerS
        Scott Sumner @sign-in-smth
        last edited by

        @sign-in-smth

        Don’t know, but maybe change your approach: Try the Replace in Files function…with that you don’t have to have the files to affect open in Notepad++.

        1 Reply Last reply Reply Quote 1
        • sign-in-smthS
          sign-in-smth
          last edited by

          yeah thanks! “find in files” seems like a nice feature, never used it before.

          however original question still remains i think, why hardcode a (low) limit of tabs for a single instance of np++? why i cant open all in one if they are just small text files and i have plenty of RAM, and its a 64bit app?

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

            I just created 1024 0-byte files, then ran notepad++ *.txt on the cmd.exe command line: all 1024 opened successfully (with NPP 32bit 7.5.6). So it’s not a file limit for 32bit Notepad++ (and thus not for 64bit, because such things generally have as much or more room in 64bit environment).

            If you opened them en masse from the explorer context menu, you probably hit a limit as to the number (or total length?) of arguments that Windows is willing to pass to the executable, and it probably then split it into a few separate runs of notepad++.exe, each with a subset of the total list of files. If you don’t have Settings > Preferences > Multi-Instance > Default (mono-instance), that would result in a separate instance of Notepad++ for every time that Windows called notepad++.

            When I opened the 1024 en masse from explorer context (with mono-instance), they seemed to appear in chunks… so I think that was Windows calling notepad++.exe multiple times. But it did eventually open them all in the single instance.

            If I switch to multiple-instance mode, Windows ran notepad++.exe with about 20-40 files in each instance.

            Thus, if you want to be able to ExplorerContextMenu-open hundreds of files into a single instance of Notepad++, you need to have mono-instance option selected – it’s Windows calling notepad++.exe multiple times that’s the culprit, and the mono-instance just insures that no matter how many times Windows calls the executable, only one Notepad++ window will be opened.

            1 Reply Last reply Reply Quote 2
            • sign-in-smthS
              sign-in-smth
              last edited by

              Peter thanks so much, some amazing research you did so quickly!
              Yes it seems to be exactly like you say, with that many files we get separate multiple calls to np++ => separate instances with multi-instance setting in prefs. and the ‘Default (mono-instance)’ fixes it.

              however i still wouldnt want to keep the mono setting enabled in np++ permanently, because i do want multiple instances when i actually call np++ multiple times with different (groups of) files.

              so now what… we need some kind of workaround for this sort of windows behavior of splitting that many arguments into separate calls to application.

              Scott SumnerS 1 Reply Last reply Reply Quote 1
              • Scott SumnerS
                Scott Sumner @sign-in-smth
                last edited by

                @sign-in-smth

                so now what… we need some kind of workaround for this sort of windows behavior of…

                Sounds like it…and when you come up with it, please post it here so others can benefit.

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

                  @sign-in-smth ,

                  An idea for a workaround: open just 1 (or a few) of the files from the explorer context menu; once that instance of NPP is open for you, drag the rest into Notepad++. I tried that with my multi-instance, and all ~1000 went into the same instance when one was context menu opened, and then the remaining that were dragged in also went in that same instance.

                  Other than that, the problem is on the Windows side, and (AFAIK) there’s nothing a multi-instance Notepad++ can do about it: it cannot know that in circumstance X, that you want multiple runnings of notepad++.exe to open in multiple instances, but in circumstance W, you want multiple runnings of notepad++.exe to open in a single instance. Maybe you’ll come up with some creative alternative. Good luck.

                  1 Reply Last reply Reply Quote 1
                  • Jim DaileyJ
                    Jim Dailey
                    last edited by

                    @sign-in-smth

                    Perhaps you can figure out an easy way to create a session file that has the files you want to edit, then use the -opensession command line option to open them as a session in a new instance.

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