mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-24 22:34:54 +02:00
Refactoring: make code more readable
This commit is contained in:
parent
662b54e28a
commit
df658a6010
@ -409,22 +409,23 @@ PWSTR stripIgnoredParams(ParamVector & params, PWSTR pCmdLine)
|
|||||||
|
|
||||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
|
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
|
||||||
{
|
{
|
||||||
generic_string cmdLineString = pCmdLine ? pCmdLine : _T("");
|
|
||||||
ParamVector params;
|
|
||||||
parseCommandLine(pCmdLine, params);
|
|
||||||
PWSTR pCmdLineWithoutIgnores = stripIgnoredParams(params, pCmdLine);
|
|
||||||
|
|
||||||
MiniDumper mdump; //for debugging purposes.
|
|
||||||
|
|
||||||
bool TheFirstOne = true;
|
bool TheFirstOne = true;
|
||||||
::SetLastError(NO_ERROR);
|
::SetLastError(NO_ERROR);
|
||||||
::CreateMutex(NULL, false, TEXT("nppInstance"));
|
::CreateMutex(NULL, false, TEXT("nppInstance"));
|
||||||
if (::GetLastError() == ERROR_ALREADY_EXISTS)
|
if (::GetLastError() == ERROR_ALREADY_EXISTS)
|
||||||
TheFirstOne = false;
|
TheFirstOne = false;
|
||||||
|
|
||||||
|
|
||||||
|
generic_string cmdLineString = pCmdLine ? pCmdLine : _T("");
|
||||||
|
ParamVector params;
|
||||||
|
parseCommandLine(pCmdLine, params);
|
||||||
|
|
||||||
|
|
||||||
// Convert commandline to notepad-compatible format, if applicable
|
// Convert commandline to notepad-compatible format, if applicable
|
||||||
|
// For treating "-notepadStyleCmdline" "/P" and "-z"
|
||||||
if ( isInList(FLAG_NOTEPAD_COMPATIBILITY, params) )
|
if ( isInList(FLAG_NOTEPAD_COMPATIBILITY, params) )
|
||||||
{
|
{
|
||||||
|
PWSTR pCmdLineWithoutIgnores = stripIgnoredParams(params, pCmdLine);
|
||||||
params = convertParamsToNotepadStyle(pCmdLineWithoutIgnores);
|
params = convertParamsToNotepadStyle(pCmdLineWithoutIgnores);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,6 +724,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
|
|||||||
MSG msg;
|
MSG msg;
|
||||||
msg.wParam = 0;
|
msg.wParam = 0;
|
||||||
Win32Exception::installHandler();
|
Win32Exception::installHandler();
|
||||||
|
MiniDumper mdump; //for debugging purposes.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
notepad_plus_plus.init(hInstance, NULL, quotFileName.c_str(), &cmdLineParams);
|
notepad_plus_plus.init(hInstance, NULL, quotFileName.c_str(), &cmdLineParams);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user