Replace N++ by Notepad++ and fix some typos

Fix also function "getWinVersionStr" not returning "Windows 11":
https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12722#discussion_r1058510340

Fix #12708, fix #12709
This commit is contained in:
Don Ho 2022-12-29 15:38:20 +01:00
parent 50e95d2267
commit 3ee8660c23
13 changed files with 29 additions and 28 deletions

View File

@ -1296,7 +1296,7 @@ bool isAssoCommandExisting(LPCTSTR FullPathName)
std::wstring s2ws(const std::string& str) std::wstring s2ws(const std::string& str)
{ {
using convert_typeX = std::codecvt_utf8<wchar_t>; using convert_typeX = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_typeX, wchar_t> converterX("Error in N++ string conversion s2ws!", L"Error in N++ string conversion s2ws!"); std::wstring_convert<convert_typeX, wchar_t> converterX("Error in Notepad++ string conversion s2ws!", L"Error in Notepad++ string conversion s2ws!");
return converterX.from_bytes(str); return converterX.from_bytes(str);
} }
@ -1304,7 +1304,7 @@ std::wstring s2ws(const std::string& str)
std::string ws2s(const std::wstring& wstr) std::string ws2s(const std::wstring& wstr)
{ {
using convert_typeX = std::codecvt_utf8<wchar_t>; using convert_typeX = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_typeX, wchar_t> converterX("Error in N++ string conversion ws2s!", L"Error in N++ string conversion ws2s!"); std::wstring_convert<convert_typeX, wchar_t> converterX("Error in Notepad++ string conversion ws2s!", L"Error in Notepad++ string conversion ws2s!");
return converterX.to_bytes(wstr); return converterX.to_bytes(wstr);
} }
@ -1543,13 +1543,13 @@ bool isUnsupportedFileName(const generic_string& fileName)
{ {
bool isUnsupported = true; bool isUnsupported = true;
// until the N++ (and its plugins) will not be prepared for filenames longer than the MAX_PATH, // until the Notepad++ (and its plugins) will not be prepared for filenames longer than the MAX_PATH,
// we have to limit also the maximum supported length below // we have to limit also the maximum supported length below
if ((fileName.size() > 0) && (fileName.size() < MAX_PATH)) if ((fileName.size() > 0) && (fileName.size() < MAX_PATH))
{ {
// possible raw filenames can contain space(s) or dot(s) at its end (e.g. "\\?\C:\file."), but the N++ advanced // possible raw filenames can contain space(s) or dot(s) at its end (e.g. "\\?\C:\file."), but the Notepad++ advanced
// Open/SaveAs IFileOpenDialog/IFileSaveDialog COM-interface based dialogs currently do not handle this well // Open/SaveAs IFileOpenDialog/IFileSaveDialog COM-interface based dialogs currently do not handle this well
// (but e.g. direct N++ Ctrl+S works ok even with these filenames) // (but e.g. direct Notepad++ Ctrl+S works ok even with these filenames)
if (!fileName.ends_with(_T('.')) && !fileName.ends_with(_T(' '))) if (!fileName.ends_with(_T('.')) && !fileName.ends_with(_T(' ')))
{ {
bool invalidASCIIChar = false; bool invalidASCIIChar = false;

View File

@ -2,7 +2,7 @@
//http://www.thunderguy.com/semicolon/2002/08/15/visual-c-exception-handling/3/ //http://www.thunderguy.com/semicolon/2002/08/15/visual-c-exception-handling/3/
//(Visual C++ exception handling) //(Visual C++ exception handling)
//By Bennett //By Bennett
//Formatting Slightly modified for N++ //Formatting Slightly modified for Notepad++
// This file is part of Notepad++ project // This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr> // Copyright (C)2021 Don HO <don.h@free.fr>

View File

@ -2,7 +2,7 @@
//http://www.thunderguy.com/semicolon/2002/08/15/visual-c-exception-handling/3/ //http://www.thunderguy.com/semicolon/2002/08/15/visual-c-exception-handling/3/
//(Visual C++ exception handling) //(Visual C++ exception handling)
//By Bennett //By Bennett
//Formatting Slightly modified for N++ //Formatting Slightly modified for Notepad++
// This file is part of Notepad++ project // This file is part of Notepad++ project
// Copyright (C)2021 Don HO <don.h@free.fr> // Copyright (C)2021 Don HO <don.h@free.fr>

View File

@ -6219,7 +6219,7 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
if (mask & (BufferChangeLanguage)) if (mask & (BufferChangeLanguage))
{ {
checkLangsMenu(-1); //let N++ do search for the item checkLangsMenu(-1); //let Notepad++ do search for the item
setLangStatus(buffer->getLangType()); setLangStatus(buffer->getLangType());
if (_mainEditView.getCurrentBuffer() == buffer) if (_mainEditView.getCurrentBuffer() == buffer)
_autoCompleteMain.setLanguage(buffer->getLangType()); _autoCompleteMain.setLanguage(buffer->getLangType());

View File

@ -384,7 +384,7 @@ private:
bool _isFileOpening = false; bool _isFileOpening = false;
bool _isAdministrator = false; bool _isAdministrator = false;
bool _isNppSessionSavedAtExit = false; // guard flag, it prevents emptying of the N++ session.xml in case of multiple WM_ENDSESSION or WM_CLOSE messages bool _isNppSessionSavedAtExit = false; // guard flag, it prevents emptying of the Notepad++ session.xml in case of multiple WM_ENDSESSION or WM_CLOSE messages
ScintillaCtrls _scintillaCtrls4Plugins; ScintillaCtrls _scintillaCtrls4Plugins;

View File

@ -2173,10 +2173,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (MainFileManager.getNbDirtyBuffers() > 0) if (MainFileManager.getNbDirtyBuffers() > 0)
{ {
// we have unsaved filebuffer(s), give the user a chance to respond // we have unsaved filebuffer(s), give the user a chance to respond
// (but only for a non-critical OS restart/shutdown and while the N++ backup mode is OFF) // (but only for a non-critical OS restart/shutdown and while the Notepad++ backup mode is OFF)
if (!isForcedShuttingDown && isFirstQueryEndSession && !nppParam.getNppGUI().isSnapshotMode()) if (!isForcedShuttingDown && isFirstQueryEndSession && !nppParam.getNppGUI().isSnapshotMode())
{ {
// if N++ has been minimized or invisible, we need to show it 1st // if Notepad++ has been minimized or invisible, we need to show it 1st
if (::IsIconic(hwnd)) if (::IsIconic(hwnd))
{ {
::ShowWindow(hwnd, SW_RESTORE); ::ShowWindow(hwnd, SW_RESTORE);
@ -2201,13 +2201,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (!isForcedShuttingDown && isFirstQueryEndSession) if (!isForcedShuttingDown && isFirstQueryEndSession)
return FALSE; // request abort of the shutdown (for a non-critical one we can give the user a chance to solve whatever is needed) return FALSE; // request abort of the shutdown (for a non-critical one we can give the user a chance to solve whatever is needed)
// here is the right place to unblock the modal-dlg blocking the main N++ wnd, because then it will be too late // here is the right place to unblock the modal-dlg blocking the main Notepad++ wnd, because then it will be too late
// to do so at the WM_ENDSESSION time (for that we need this thread message queue...) // to do so at the WM_ENDSESSION time (for that we need this thread message queue...)
// in most cases we will need to take care and programmatically close such dialogs in order to exit gracefully, // in most cases we will need to take care and programmatically close such dialogs in order to exit gracefully,
// otherwise the N++ most probably crashes itself without any tidy-up // otherwise the Notepad++ most probably crashes itself without any tidy-up
string strLog = "Main N++ wnd is disabled by (an active modal-dlg?): "; string strLog = "Main Notepad++ wnd is disabled by (an active modal-dlg?): ";
char szBuf[MAX_PATH + 128] = { 0 }; char szBuf[MAX_PATH + 128] = { 0 };
HWND hActiveWnd = ::GetActiveWindow(); HWND hActiveWnd = ::GetActiveWindow();
@ -2246,7 +2246,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// re-test // re-test
if (::IsWindowEnabled(hwnd)) if (::IsWindowEnabled(hwnd))
strLog += " -> Main N++ wnd has been successfully reenabled."; strLog += " -> Main Notepad++ wnd has been successfully reenabled.";
if (nppParam.doNppLogNulContentCorruptionIssue()) if (nppParam.doNppLogNulContentCorruptionIssue())
{ {
@ -2258,7 +2258,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
} }
} }
// TODO: here is the last opportunity to call the following WINAPI in a possible future version of the N++ // TODO: here is the last opportunity to call the following WINAPI in a possible future version of the Notepad++
// //
// flags RESTART_NO_PATCH and RESTART_NO_REBOOT are not set, so we should be restarted if terminated by an update or restart // flags RESTART_NO_PATCH and RESTART_NO_REBOOT are not set, so we should be restarted if terminated by an update or restart
//::RegisterApplicationRestart(restartCommandLine.c_str(), RESTART_NO_CRASH | RESTART_NO_HANG); //::RegisterApplicationRestart(restartCommandLine.c_str(), RESTART_NO_CRASH | RESTART_NO_HANG);
@ -2306,8 +2306,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (wParam == FALSE) if (wParam == FALSE)
{ {
// the session is not being ended after all // the session is not being ended after all
// - it happens when either the N++ returns FALSE to non-critical WM_QUERYENDSESSION or any other app with higher shutdown level // - it happens when either the Notepad++ returns FALSE to non-critical WM_QUERYENDSESSION or any other app with higher shutdown level
// than N++ (app shuttdown order can be checked by the GetProcessShutdownParameters WINAPI) // than Notepad++ (app shuttdown order can be checked by the GetProcessShutdownParameters WINAPI)
// - we will not try to reset back our nppParam _isEndSessionStarted flag somehow, because of we should now that there was already // - we will not try to reset back our nppParam _isEndSessionStarted flag somehow, because of we should now that there was already
// a previous shutdown attempt, otherwise we could stubbornly repeat returning FALSE for the next WM_QUERYENDSESSION and // a previous shutdown attempt, otherwise we could stubbornly repeat returning FALSE for the next WM_QUERYENDSESSION and
// the system will terminate us // the system will terminate us
@ -2319,7 +2319,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// so DO NOT e.g. Send/Post any message from here onwards!!! // so DO NOT e.g. Send/Post any message from here onwards!!!
nppParam.endSessionStart(); // ensure nppParam.endSessionStart(); // ensure
nppParam.makeEndSessionCritical(); // set our exit-flag to critical even if the bitmask has not the ENDSESSION_CRITICAL set nppParam.makeEndSessionCritical(); // set our exit-flag to critical even if the bitmask has not the ENDSESSION_CRITICAL set
// do not return 0 here and continue to the N++ standard WM_CLOSE code-part (no verbose GUI there this time!!!) // do not return 0 here and continue to the Notepad++ standard WM_CLOSE code-part (no verbose GUI there this time!!!)
} }
} // case WM_ENDSESSION: } // case WM_ENDSESSION:

View File

@ -185,7 +185,7 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
{ {
// TODO: // TODO:
// for the raw filenames we can allow even the usually unsupported filenames in the future, // for the raw filenames we can allow even the usually unsupported filenames in the future,
// but not now as it is not fully supported by the N++ COM IFileDialog based Open/SaveAs dialogs // but not now as it is not fully supported by the Notepad++ COM IFileDialog based Open/SaveAs dialogs
//if (isRawFileName) //if (isRawFileName)
//{ //{
// int answer = _nativeLangSpeaker.messageBox("OpenNonconformingWin32FileName", // int answer = _nativeLangSpeaker.messageBox("OpenNonconformingWin32FileName",
@ -200,7 +200,7 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
//} //}
//else //else
//{ //{
// unsupported, use the existing N++ file dialog to report // unsupported, use the existing Notepad++ file dialog to report
_nativeLangSpeaker.messageBox("OpenFileError", _nativeLangSpeaker.messageBox("OpenFileError",
_pPublicInterface->getHSelf(), _pPublicInterface->getHSelf(),
TEXT("Cannot open file \"$STR_REPLACE$\"."), TEXT("Cannot open file \"$STR_REPLACE$\"."),

View File

@ -1127,7 +1127,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
if (_rebarBottom.getHSelf() == lpnm->hdr.hwndFrom) if (_rebarBottom.getHSelf() == lpnm->hdr.hwndFrom)
notifRebar = &_rebarBottom; notifRebar = &_rebarBottom;
//If N++ ID, use proper object //If Notepad++ ID, use proper object
if (lpnm->wID == REBAR_BAR_TOOLBAR) if (lpnm->wID == REBAR_BAR_TOOLBAR)
{ {
POINT pt{}; POINT pt{};

View File

@ -7619,6 +7619,7 @@ generic_string NppParameters:: getWinVersionStr() const
case WV_WIN8: return TEXT("Windows 8"); case WV_WIN8: return TEXT("Windows 8");
case WV_WIN81: return TEXT("Windows 8.1"); case WV_WIN81: return TEXT("Windows 8.1");
case WV_WIN10: return TEXT("Windows 10"); case WV_WIN10: return TEXT("Windows 10");
case WV_WIN11: return TEXT("Windows 11");
default: /*case WV_UNKNOWN:*/ return TEXT("Windows unknown version"); default: /*case WV_UNKNOWN:*/ return TEXT("Windows unknown version");
} }
} }

View File

@ -580,7 +580,7 @@ void AutoCompletion::showPathCompletion()
hFind = ::FindFirstFile(searchString.c_str(), &data); hFind = ::FindFirstFile(searchString.c_str(), &data);
if (hFind != INVALID_HANDLE_VALUE) if (hFind != INVALID_HANDLE_VALUE)
{ {
// Maximum number of entries to show. Without this it appears to the user like N++ hangs when autocompleting // Maximum number of entries to show. Without this it appears to the user like Notepad++ hangs when autocompleting
// some really large directories (c:\windows\winxsys on my system for instance). // some really large directories (c:\windows\winxsys on my system for instance).
const unsigned int maxEntries = 2000; const unsigned int maxEntries = 2000;
unsigned int counter = 0; unsigned int counter = 0;

View File

@ -3,8 +3,8 @@
<InternalCommands /> <InternalCommands />
<!-- <!--
You can reorganize you Macro menu & Run menu by adding attribute 'FolderName="My sub-menu name"' in the Macro nodes & Command nodes respectively, You can organize you Macro menu & Run menu by adding the attribute 'FolderName="My sub-menu name"' to any Macro or Command node.
for having "My sub-menu name" as your sub-menu entry name. Please consider the following examples: This will place the corresponding node within a "My sub-menu name" sub-menu in the appropriate menu. Please consider the following examples:
--> -->
<Macros> <Macros>
<!-- <!--

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!-- <!--
By modifying this file and rename it to "tabContextMenu_example.xml", you can customize your context menu popuped as right clicking on the tab zone. By modifying this file and renaming it to "tabContextMenu.xml", you can customize your context menu popuped while right clicking on the tab zone.
It may be more convenient to access to your frequent used commands via context menu than via the top menu. It may be more convenient to access to your frequent used commands via the context menu than via the top menu.
Please check "How to Customize the Context Menu" on: Please check "How to Customize the Context Menu" on:
https://npp-user-manual.org/docs/config-files/#the-context-menu-tabcontextmenu-xml https://npp-user-manual.org/docs/config-files/#the-context-menu-tabcontextmenu-xml

View File

@ -323,7 +323,7 @@ void doException(Notepad_plus_Window & notepad_plus_plus)
TCHAR tmpDir[1024]; TCHAR tmpDir[1024];
GetTempPath(1024, tmpDir); GetTempPath(1024, tmpDir);
generic_string emergencySavedDir = tmpDir; generic_string emergencySavedDir = tmpDir;
emergencySavedDir += TEXT("\\N++RECOV"); emergencySavedDir += TEXT("\\Notepad++ RECOV");
bool res = notepad_plus_plus.emergency(emergencySavedDir); bool res = notepad_plus_plus.emergency(emergencySavedDir);
if (res) if (res)