From cf2175e4792f9d99d8a98698e46714ed36893eee Mon Sep 17 00:00:00 2001 From: Udo Hoffmann Date: Thu, 23 Apr 2020 13:45:41 +0200 Subject: [PATCH] Fix wrong project panel at start by openning a project via command line Fix #8126, close #8161 --- PowerEditor/src/Notepad_plus.h | 2 ++ PowerEditor/src/Notepad_plus_Window.cpp | 4 ++++ PowerEditor/src/NppIO.cpp | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 8f6cb05e5..9aef0676c 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -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 > _hideLinesMarks; diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 9d67e8b43..0e72bafb6 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -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; diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 2063eebeb..f528aa992 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -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; }