diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 750b15abc..bce3fe06b 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1931,7 +1931,6 @@ BOOL Notepad_plus::notify(SCNotification *notification) else docGotoAnotherEditView(TransferMove); } - //else on fout rien!!! // It's non view group } break; } @@ -3918,6 +3917,14 @@ void Notepad_plus::command(int id) checkSyncState(); break; + case IDM_VIEW_GOTO_NEW_INSTANCE : + docOpenInNewInstance(TransferMove); + break; + + case IDM_VIEW_LOAD_IN_NEW_INSTANCE: + docOpenInNewInstance(TransferClone); + break; + case IDM_VIEW_SWITCHTO_MAIN: switchEditViewTo(MAIN_VIEW); break; @@ -4800,6 +4807,13 @@ void Notepad_plus::undockUserDlg() (ScintillaEditView::getUserDefineDlg())->display(); //(_pEditView->getUserDefineDlg())->display(); } +void Notepad_plus::docOpenInNewInstance(FileTransferMode mode) +{ + Command cmd(TEXT("$(NPP_DIRECTORY)\\notepad++.exe $(FULL_CURRENT_PATH) -multiInst -nosession")); + cmd.run(_hSelf); + if (mode == TransferMove) + doClose(_pEditView->getCurrentBufferID(), currentView()); +} void Notepad_plus::docGotoAnotherEditView(FileTransferMode mode) { @@ -4808,9 +4822,12 @@ void Notepad_plus::docGotoAnotherEditView(FileTransferMode mode) BufferID current = _pEditView->getCurrentBufferID(); int viewToGo = otherView(); int indexFound = _pNonDocTab->getIndexByBuffer(current); - if (indexFound != -1) { //activate it + if (indexFound != -1) //activate it + { activateBuffer(current, otherView()); - } else { //open the document, also copying the position + } + else //open the document, also copying the position + { loadBufferIntoView(current, viewToGo); Buffer * buf = MainFileManager->getBufferByID(current); _pEditView->saveCurrentPos(); //allow copying of position @@ -4826,7 +4843,8 @@ void Notepad_plus::docGotoAnotherEditView(FileTransferMode mode) } //Close the document if we transfered the document instead of cloning it - if (mode == TransferMove) { + if (mode == TransferMove) + { //just close the activate document, since thats the one we moved (no search) doClose(_pEditView->getCurrentBufferID(), currentView()); } // else it was cone, so leave it diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 7c62da956..daccdc8e1 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -376,6 +376,7 @@ private: int switchEditViewTo(int gid); //activate other view (set focus etc) void docGotoAnotherEditView(FileTransferMode mode); //TransferMode + void docOpenInNewInstance(FileTransferMode mode); void loadBufferIntoView(BufferID id, int whichOne, bool dontClose = false); //Doesnt _activate_ the buffer void removeBufferFromView(BufferID id, int whichOne); //Activates alternative of possible, or creates clean document if not clean already diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 588f8e9f3..5cd8fad93 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -319,6 +319,8 @@ BEGIN MENUITEM "Clone to another view", IDM_VIEW_CLONE_TO_ANOTHER_VIEW MENUITEM "Activate main view", IDM_VIEW_SWITCHTO_MAIN MENUITEM "Activate sub view", IDM_VIEW_SWITCHTO_SUB + MENUITEM "Go to new instance", IDM_VIEW_GOTO_NEW_INSTANCE + MENUITEM "Open to new instance", IDM_VIEW_LOAD_IN_NEW_INSTANCE MENUITEM SEPARATOR MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV MENUITEM "Synchronize Horizontal Scrolling", IDM_VIEW_SYNSCROLLH diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 18f02f524..9fd38ac76 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -178,8 +178,10 @@ #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8) - #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 - #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 + #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 + #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 + #define IDM_VIEW_GOTO_NEW_INSTANCE 10003 + #define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004 #define IDM_VIEW_SWITCHTO_MAIN (IDM_VIEW + 70) #define IDM_VIEW_SWITCHTO_SUB (IDM_VIEW + 71) diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index 3bdd78f4f..9b811366b 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -132,7 +132,7 @@ Name="VCCLCompilerTool" Optimization="3" InlineFunctionExpansion="0" - FavorSizeOrSpeed="2" + FavorSizeOrSpeed="1" OmitFramePointers="false" WholeProgramOptimization="false" AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common"