diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 6eefc05b..7390fcc9 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1,6 +1,6 @@ - +
@@ -75,6 +75,7 @@ + @@ -355,6 +356,7 @@ +
diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index 8855e473..83a86750 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -1,6 +1,6 @@ - +
@@ -75,6 +75,7 @@ + @@ -320,8 +321,6 @@ - - @@ -357,6 +356,7 @@ +
@@ -535,13 +535,13 @@ - + - + @@ -912,6 +912,8 @@ You can define several column markers by using white space to separate the diffe + + @@ -1016,6 +1018,7 @@ You can define several column markers by using white space to separate the diffe + @@ -1317,6 +1320,7 @@ Find in all files except exe, obj && log: + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 3aca7a38..c01a610d 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -1,6 +1,6 @@ - +
@@ -80,6 +80,7 @@ + @@ -352,6 +353,7 @@ +
diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index ec92d6a8..96af7f1d 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -1,6 +1,6 @@ - +
@@ -75,6 +75,7 @@ + @@ -351,6 +352,7 @@ +
diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index a107f993..41d332fa 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -237,6 +237,8 @@ BEGIN BEGIN MENUITEM "Explorer", IDM_FILE_OPEN_FOLDER MENUITEM "cmd", IDM_FILE_OPEN_CMD + MENUITEM SEPARATOR + MENUITEM "Folder as Workspace", IDM_FILE_CONTAININGFOLDERASWORKSPACE END MENUITEM "Open in Default Viewer", IDM_FILE_OPEN_DEFAULT_VIEWER MENUITEM "Open Folder as Workspace...", IDM_FILE_OPENFOLDERASWORSPACE diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index ebd424ab..3bc6b800 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -94,7 +94,26 @@ void Notepad_plus::command(int id) cmd.run(_pPublicInterface->getHSelf(), TEXT("$(CURRENT_DIRECTORY)")); } break; - + + case IDM_FILE_CONTAININGFOLDERASWORKSPACE: + { + TCHAR currentFile[CURRENTWORD_MAXLENGTH]; + TCHAR currentDir[CURRENTWORD_MAXLENGTH]; + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETFULLCURRENTPATH, CURRENTWORD_MAXLENGTH, reinterpret_cast(currentFile)); + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_GETCURRENTDIRECTORY, CURRENTWORD_MAXLENGTH, reinterpret_cast(currentDir)); + + if (!_pFileBrowser) + { + command(IDM_VIEW_FILEBROWSER); + } + + vector folders; + folders.push_back(currentDir); + + launchFileBrowser(folders, currentFile); + } + break; + case IDM_FILE_OPEN_DEFAULT_VIEWER: { // Opens file in its default viewer. @@ -126,7 +145,7 @@ void Notepad_plus::command(int id) case IDM_FILE_OPENFOLDERASWORSPACE: { generic_string folderPath = folderBrowser(_pPublicInterface->getHSelf(), TEXT("Select a folder to add in Folder as Workspace panel")); - if (not folderPath.empty()) + if (!folderPath.empty()) { if (_pFileBrowser == nullptr) // first launch, check in params to open folders { @@ -424,7 +443,7 @@ void Notepad_plus::command(int id) fullFilePath += TEXT("\""); if (id == IDM_EDIT_OPENINFOLDER || - (id == IDM_EDIT_OPENASFILE && not ::PathIsDirectory(curentWord))) + (id == IDM_EDIT_OPENASFILE && !::PathIsDirectory(curentWord))) ::ShellExecute(hwnd, TEXT("open"), cmd2Exec, fullFilePath.c_str(), TEXT("."), SW_SHOW); } else // Full file path - need concatenate with current full file path @@ -439,7 +458,7 @@ void Notepad_plus::command(int id) fullFilePath += curentWord; if ((id == IDM_EDIT_OPENASFILE && - (not::PathFileExists(fullFilePath.c_str() + 1) || ::PathIsDirectory(fullFilePath.c_str() + 1)))) + (!::PathFileExists(fullFilePath.c_str() + 1) || ::PathIsDirectory(fullFilePath.c_str() + 1)))) { _nativeLangSpeaker.messageBox("FilePathNotFoundWarning", _pPublicInterface->getHSelf(), @@ -700,7 +719,7 @@ void Notepad_plus::command(int id) } else { - if (not (*pp[idx])->isClosed()) + if (!(*pp[idx])->isClosed()) { if ((*pp[idx])->checkIfNeedSave()) { @@ -769,7 +788,7 @@ void Notepad_plus::command(int id) case IDM_VIEW_DOC_MAP: { - if (_pDocMap && (not _pDocMap->isClosed())) + if (_pDocMap && (!_pDocMap->isClosed())) { _pDocMap->display(false); _pDocMap->vzDlgDisplay(false); @@ -2252,7 +2271,7 @@ void Notepad_plus::command(int id) Buffer* buf = _pEditView->getCurrentBuffer(); - if (not buf->isReadOnly()) + if (!buf->isReadOnly()) { std::lock_guard lock(command_mutex); buf->setEolFormat(newFormat); @@ -2440,7 +2459,7 @@ void Notepad_plus::command(int id) return; } - if (not buf->isDirty()) + if (!buf->isDirty()) { buf->setEncoding(encoding); buf->setUnicodeMode(uniCookie); @@ -3310,7 +3329,7 @@ void Notepad_plus::command(int id) case IDM_FILE_RESTORELASTCLOSEDFILE: { generic_string lastOpenedFullPath = _lastRecentFileList.getFirstItem(); - if (not lastOpenedFullPath.empty()) + if (!lastOpenedFullPath.empty()) { BufferID lastOpened = doOpen(lastOpenedFullPath); if (lastOpened != BUFFER_INVALID) diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index cfc49fed..ba282318 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -531,6 +531,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) itemUnitArray.push_back(MenuItemUnit(0, NULL)); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_FOLDER, TEXT("Open Containing Folder in Explorer"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_CMD, TEXT("Open Containing Folder in cmd"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CONTAININGFOLDERASWORKSPACE, TEXT("Open Containing Folder as Workspace"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_DEFAULT_VIEWER, TEXT("Open in Default Viewer"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index f20d3885..c4a351c4 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -404,32 +404,33 @@ static const int tabContextMenuItemPos[] = { // +-------------- The order in tab menu (NppNotification.cpp : if (!_tabPopupMenu.isCreated()) // | -// | +------ Number in english.xml (.xml) : -// | | - 0, // 0 : Close - 1, // 1 : Close ALL BUT This - 5, // 2 : Save - 6, // 3 : Save As - 10, // 4 : Print - 24, // 5 : Move to Other View - 25, // 6 : Clone to Other View - 20, // 7 : Full File Path to Clipboard - 21, // 8 : Filename to Clipboard - 22, // 9 : Current Dir. Path to Clipboard +// | +------ Number in english.xml (.xml) : +// | | + 0, // 0: Close + 1, // 1: Close ALL BUT This + 5, // 2: Save + 6, // 3: Save As + 10, // 4: Print + 25, // 5: Move to Other View + 26, // 6: Clone to Other View + 21, // 7: Full File Path to Clipboard + 22, // 8: Filename to Clipboard + 23, // 9: Current Dir. Path to Clipboard 7, // 10: Rename 8, // 11: Move to Recycle Bin - 17, // 12: Read-Only - 18, // 13: Clear Read-Only Flag - 26, // 14: Move to New Instance - 27, // 15: Open to New Instance + 18, // 12: Read-Only + 19, // 13: Clear Read-Only Flag + 27, // 14: Move to New Instance + 28, // 15: Open to New Instance 9, // 16: Reload 2, // 17: Close ALL to the Left 3, // 18: Close ALL to the Right - 12, // 19: Open Containing Folder in Explorer - 13, // 20: Open Containing Folder in cmd - 15, // 21: Open in Default Viewer + 12, // 19: Open Containing Folder in Explorer + 13, // 20: Open Containing Folder in cmd + 16, // 21: Open in Default Viewer 4, // 22: Close ALL Unchanged - -1 //-------End + 14, // 23: Open Containing Folder as Workspace + -1 //-------End }; diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 4d738366..0c741027 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -32,35 +32,36 @@ #define IDM_FILE (IDM + 1000) // IMPORTANT: If list below is modified, you have to change the value of IDM_FILEMENU_LASTONE and IDM_FILEMENU_EXISTCMDPOSITION - #define IDM_FILE_NEW (IDM_FILE + 1) - #define IDM_FILE_OPEN (IDM_FILE + 2) - #define IDM_FILE_CLOSE (IDM_FILE + 3) - #define IDM_FILE_CLOSEALL (IDM_FILE + 4) - #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) - #define IDM_FILE_SAVE (IDM_FILE + 6) - #define IDM_FILE_SAVEALL (IDM_FILE + 7) - #define IDM_FILE_SAVEAS (IDM_FILE + 8) - #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) - #define IDM_FILE_PRINT (IDM_FILE + 10) - #define IDM_FILE_PRINTNOW 1001 - #define IDM_FILE_EXIT (IDM_FILE + 11) - #define IDM_FILE_LOADSESSION (IDM_FILE + 12) - #define IDM_FILE_SAVESESSION (IDM_FILE + 13) - #define IDM_FILE_RELOAD (IDM_FILE + 14) - #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) - #define IDM_FILE_DELETE (IDM_FILE + 16) - #define IDM_FILE_RENAME (IDM_FILE + 17) - #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) - #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) - #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) - #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) - #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) - #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) - #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_NEW (IDM_FILE + 1) + #define IDM_FILE_OPEN (IDM_FILE + 2) + #define IDM_FILE_CLOSE (IDM_FILE + 3) + #define IDM_FILE_CLOSEALL (IDM_FILE + 4) + #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) + #define IDM_FILE_SAVE (IDM_FILE + 6) + #define IDM_FILE_SAVEALL (IDM_FILE + 7) + #define IDM_FILE_SAVEAS (IDM_FILE + 8) + #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) + #define IDM_FILE_PRINT (IDM_FILE + 10) + #define IDM_FILE_PRINTNOW 1001 + #define IDM_FILE_EXIT (IDM_FILE + 11) + #define IDM_FILE_LOADSESSION (IDM_FILE + 12) + #define IDM_FILE_SAVESESSION (IDM_FILE + 13) + #define IDM_FILE_RELOAD (IDM_FILE + 14) + #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) + #define IDM_FILE_DELETE (IDM_FILE + 16) + #define IDM_FILE_RENAME (IDM_FILE + 17) + #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) + #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) + #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) + #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) + #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) + #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) + #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_CONTAININGFOLDERASWORKSPACE (IDM_FILE + 25) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_UNCHANGED + #define IDM_FILEMENU_LASTONE IDM_FILE_CONTAININGFOLDERASWORKSPACE // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items