Community
    • Login

    Bug (?) Highlight text in a file then select Run -> Open file in another instance causes loop

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 1.2k 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.
    • Ryan LloydR
      Ryan Lloyd
      last edited by

      If you highlight text in a file then select Run -> Open file in another instance, the other instance opens and goes into a loop where NotePad++ will attempt to create a file with a name of each word in the highlighted text.

      E.g. File contains the words

      Hello World

      NotePad++ will open the other instance, and try to create a file called Hello, then fail, and another called World and also fail.

      Is this a known issue?

      I did this by mistake with a SQL file and a lot of it highlighted, and got about 50 dialogue windows asking to create files ‘CASE’ ‘WHEN’ etc…

      Not highlighting any text and just selecting ‘Run -> Open file in another instance’ doesnt work either. The New instance just has a blank ‘New 1’ file open instead.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Ryan Lloyd
        last edited by

        @Ryan-Lloyd

        So here’s how it works. It takes your selection and assumes that you want to open that as a file (or files). If your selection contains spaces and doesn’t have double quotes, then each space-separated “token” will be considered a different file. If each token doesn’t contain path information, Notepad++ will attempt to open that “file” in the current folder (which in the portable install I use, is the folder that Notepad++.exe lives in). If the “intended” file isn’t found, Notepad++ will prompt to create it.

        I think this as described is what you are seeing. I don’t think of it as a “bug”, but maybe just something that is less than ideal. :-)
        If you are going to use this feature, I’d suggest being careful about what text is selected when you activate it.

        Contrast this behavior with the right-click (in a document tab window) entry Open File. There, if you have a similar selection when invoking the feature, you get a popup box that says The file you’re trying to open doesn’t exist. Perhaps it would be better if the Run menu’s version worked similarly…

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