• Login
Community
  • Login

Issue with Open in another Instance

Scheduled Pinned Locked Moved General Discussion
10 Posts 2 Posters 7.0k 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.
  • B
    Brayner Chomsky Luther Firth-Zinn
    last edited by May 17, 2017, 1:07 AM

    Hi,

    Just a small grip with otherwise an excellent product… If you have text Highlighted, and you select “Open in a another Instance” Notepad++ assumes you have highlighted filenames… and if you have made the mistake of highlighting 100 lines of text for each line it will come up with the message “… \some text doesn’t exist. Create it?”
    for every line.

    The only way is then to go to task manager and kill Notepad++.

    Can I suggest a prompt if text is highlighted… “x lines have been highlighted do you wish to Open or Create files in the New Instance?”

    Something like that would be great as I always create separate instances.

    Great editor by the way I love it.
    Keep up the good work.

    Regards.

    C 1 Reply Last reply May 17, 2017, 9:13 PM Reply Quote 0
    • C
      Claudia Frank @Brayner Chomsky Luther Firth-Zinn
      last edited by Claudia Frank May 17, 2017, 9:13 PM May 17, 2017, 9:13 PM

      @Brayner-Chomsky-Luther-Firth-Zinn

      looks like you have an outdated version, could this be?

      If I use the context menu from the open document I only have open file
      and even if more lines are selected it only tries it once.

      If I use the context menu from the tab, only move to other view and clone to other view are enabled.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • B
        Brayner Chomsky Luther Firth-Zinn
        last edited by May 19, 2017, 9:07 PM

        I am using version 7.3.3 (32 bit)

        What I mean is, Highlight Some text and then go to the Run Menu
        and select “Open in another Instance”

        And then you will see what I mean.

        Or simply add a Yes, No, Cancel option. If Cancel is selected it stops trying create/open files and simple opens up the New Instance which is what I want.
        :-)

        Regards,

        Brayner

        C 1 Reply Last reply May 19, 2017, 9:37 PM Reply Quote 0
        • C
          Claudia Frank @Brayner Chomsky Luther Firth-Zinn
          last edited by Claudia Frank May 19, 2017, 9:38 PM May 19, 2017, 9:37 PM

          @Brayner-Chomsky-Luther-Firth-Zinn

          Hello Brayner,

          you stated

          Something like that would be great as I always create separate instances.

          does this mean you do not need the open that file in a new instance at all?
          If so, you can configure it yourself. All these Run commands are stored in
          shortcuts.xml file.
          If you open it you will see something similar to this

          <UserDefinedCommands>
              <Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox &quot;$(FULL_CURRENT_PATH)&quot;</Command>
              <Command name="Get php help" Ctrl="no" Alt="yes" Shift="no" Key="112">http://www.php.net/$(CURRENT_WORD)</Command>
              <Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command>
              <Command name="Open file in another instance" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_FULL_FILE_PATH) $(CURRENT_WORD) -nosession -multiInst</Command>
          </UserDefinedCommands>
          

          Similar, because I have already deleted some that I don’t use.
          As you see, the “Open file in another instance” uses two variable parameters

          $(NPP_FULL_FILE_PATH)
          and
          $(CURRENT_WORD)

          $(NPP_FULL_FILE_PATH) will be replaced with the real path notepad++ was started from and $(CURRENT_WORD) with the current selected word.
          What you can do is to delete this parameter then it will just open another npp instance.
          Or you create an additional entry which only has the first variable parameter.
          Something like

          <Command name=“Open another instance” Ctrl=“no” Alt=“yes” Shift=“no” Key=“117”>$(NPP_FULL_FILE_PATH) -nosession -multiInst</Command>

          Afterwards use shortcut mapper to assign an unique shortcut.

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 1
          • B
            Brayner Chomsky Luther Firth-Zinn
            last edited by May 19, 2017, 11:41 PM

            Wow thanks, I never knew it was that easy!
            You’re a star… I have put up with killing Notepad++ process for years.

            I will edit the xml file as suggested.

            Thanks for your Help

            Regards,

            Brayner

            1 Reply Last reply Reply Quote 1
            • B
              Brayner Chomsky Luther Firth-Zinn
              last edited by May 20, 2017, 12:24 AM

              umm … I have just done what you said…

              I have amended the line it now reads this:

                  <Command name="New Open in another instance 2" Ctrl="no" Alt="yes" Shift="no" Key="117">$(NPP_DIRECTORY)\notepad++.exe -nosession -multiInst</Command>
              

              and two minor things

              1. The menu Text when I start NPP still still says New Open in another instance and not *New Open in another instance 2 * (just an observation)

              2. I still get the popup when starting the New Instance… but this time the Message box contains all the text I have highlighted as one string… So even if I have highlighted 20 lines I get one message bot not 20… a big improvement, I am grateful

              Just curious as even though I have removed $(CURRENT_WORD) it is still passing an additional command line argument to notepad++.exe

              Strange but true.

              I am still in a happy place.

              Regards,

              Brayner

              C 1 Reply Last reply May 20, 2017, 12:26 AM Reply Quote 1
              • C
                Claudia Frank @Brayner Chomsky Luther Firth-Zinn
                last edited by Claudia Frank May 20, 2017, 12:28 AM May 20, 2017, 12:26 AM

                @Brayner-Chomsky-Luther-Firth-Zinn

                could you post the debug-info? Can be found under ? menu.
                Maybe you edited the wrong file? Or another unix/windows difference??

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • B
                  Brayner Chomsky Luther Firth-Zinn
                  last edited by Brayner Chomsky Luther Firth-Zinn May 20, 2017, 2:34 PM May 20, 2017, 2:31 PM

                  Here You are:

                  Notepad++ v7.3.3 (32-bit)
                  Build time : Mar 8 2017 - 03:37:37
                  Path : C:\Program Files (x86)\Notepad++\notepad++.exe
                  Admin mode : OFF
                  Local Conf mode : OFF
                  OS : Windows 10 (64-bit)
                  Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll PluginManager.dll SpellChecker.dll

                  ps I am a developer and I edited the file in C:\Program Files (x86)\Notepad++\shortcuts.xml
                  and Since I made the change it has made a difference just with that side effect :-)

                  <NotepadPlus>
                  <InternalCommands />
                  <Macros>
                  <Macro name=“Trim Trailing and save” Ctrl=“no” Alt=“yes” Shift=“yes” Key=“83”>
                  <Action type=“2” message=“0” wParam=“42024” lParam=“0” sParam=“” />
                  <Action type=“2” message=“0” wParam=“41006” lParam=“0” sParam=“” />
                  </Macro>
                  </Macros>
                  <UserDefinedCommands>
                  <Command name=“Launch in Firefox” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“88”>firefox “$(FULL_CURRENT_PATH)”</Command>
                  <Command name=“Launch in IE” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“73”>iexplore “$(FULL_CURRENT_PATH)”</Command>
                  <Command name=“Launch in Chrome” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“82”>chrome “$(FULL_CURRENT_PATH)”</Command>
                  <Command name=“Launch in Safari” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“70”>safari “$(FULL_CURRENT_PATH)”</Command>
                  <Command name=“Get php help” Ctrl=“no” Alt=“yes” Shift=“no” Key=“112”>http://www.php.net/ $(CURRENT_WORD) </Command>
                  <Command name=“Google Search” Ctrl=“no” Alt=“yes” Shift=“no” Key=“113”>http://www.google.com/search?q=$(CURRENT_WORD) </Command>
                  <Command name=“Wikipedia Search” Ctrl=“no” Alt=“yes” Shift=“no” Key=“114”>http://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD) </Command>
                  <Command name=“Open file” Ctrl=“no” Alt=“yes” Shift=“no” Key=“116”>$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD)</Command>
                  <Command name=“Open in another instance” Ctrl=“no” Alt=“yes” Shift=“no” Key=“117”>$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_WORD) -nosession -multiInst</Command>
                  <Command name=“Open containing folder” Ctrl=“no” Alt=“no” Shift=“no” Key=“0”>explorer $(CURRENT_DIRECTORY)</Command>
                  <Command name=“Open current dir cmd” Ctrl=“no” Alt=“no” Shift=“no” Key=“0”>cmd /K cd /d $(CURRENT_DIRECTORY)</Command>
                  <Command name=“Send via Outlook” Ctrl=“yes” Alt=“yes” Shift=“yes” Key=“79”>outlook /a “$(FULL_CURRENT_PATH)”</Command>
                  </UserDefinedCommands>
                  <PluginCommands />
                  <ScintillaKeys />
                  </NotepadPlus>

                  Regards,

                  Brayner

                  C 1 Reply Last reply May 20, 2017, 4:08 PM Reply Quote 0
                  • C
                    Claudia Frank @Brayner Chomsky Luther Firth-Zinn
                    last edited by Claudia Frank May 20, 2017, 4:08 PM May 20, 2017, 4:08 PM

                    @Brayner-Chomsky-Luther-Firth-Zinn

                    Local Conf mode : OFF

                    normally means that the configuration files are stored and used from the %APPDATA% directory.
                    Maybe this explains the different behavior - not sure.
                    Would you mind giving it a try to edit the shortcuts.xml under %APPDATA%\notepad++ ?

                    Cheers
                    Claudia

                    1 Reply Last reply Reply Quote 1
                    • B
                      Brayner Chomsky Luther Firth-Zinn
                      last edited by May 20, 2017, 9:04 PM

                      That’s it ! its worked perfectly, the behavior is fine now, I can have 1,000 lines highlighted and it opens up the new instance without any message boxes.

                      Thanks so much for your time and effort.

                      Regards,

                      Brayner

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