np++ 64bit - max number of tabs



  • 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?



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



  • 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?



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



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



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



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



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


Log in to reply