• Login
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.3k 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.
  • R
    Ryan Lloyd
    last edited by Feb 15, 2018, 11:25 AM

    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.

    S 1 Reply Last reply Feb 15, 2018, 12:50 PM Reply Quote 0
    • S
      Scott Sumner @Ryan Lloyd
      last edited by Feb 15, 2018, 12:50 PM

      @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
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors