Fix wrong project panel at start by openning a project via command line

Fix #8126, close #8161
This commit is contained in:
Udo Hoffmann 2020-04-23 13:45:41 +02:00 committed by Don HO
parent 3a9a31afb4
commit cf2175e479
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 8 additions and 1 deletions

View File

@ -389,6 +389,8 @@ private:
// then WM_ENDSESSION is send with wParam == FALSE
// in this case this boolean is set true, so Notepad++ will quit and its current session will be saved
bool _isWorkspaceFileLoadedFromCommandLine = false;
ScintillaCtrls _scintillaCtrls4Plugins;
std::vector<std::pair<int, int> > _hideLinesMarks;

View File

@ -245,6 +245,10 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
{
_notepad_plus_plus_core.launchFileBrowser(fns, true);
}
else if (_notepad_plus_plus_core._isWorkspaceFileLoadedFromCommandLine)
{
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_PROJECT_PANEL_1, 0);
}
// Notify plugins that Notepad++ is ready
SCNotification scnN;

View File

@ -211,7 +211,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
if (isFileWorkspace(longFileName) && PathFileExists(longFileName))
{
nppParam.setWorkSpaceFilePath(0, longFileName);
command(IDM_VIEW_PROJECT_PANEL_1);
_isWorkspaceFileLoadedFromCommandLine = true;
// command(IDM_VIEW_PROJECT_PANEL_1);
return BUFFER_INVALID;
}