diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 6f7d7d98..847ea66a 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -194,6 +194,13 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV #define NPPM_CHECKDOCSTATUS (NPPMSG + 53) // VOID NPPM_CHECKDOCSTATUS(TRUE, 0) + #define NPPM_ENABLECHECKDOCOPT (NPPMSG + 54) + // VOID NPPM_ENABLECHECKDOCOPT(OPT, 0) + // where OPT is : + #define CHECKDOCOPT_NONE 0 + #define CHECKDOCOPT_UPDATESILENTLY 1 + #define CHECKDOCOPT_UPDATEGO2END 2 + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 1f1b9131..b3e6c4f0 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -7581,7 +7581,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa { if (wParam == TRUE) // if npp is about to be activated { - NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI()); + const NppGUI & nppgui = pNppParam->getNppGUI(); if (LOWORD(wParam) && (nppgui._fileAutoDetection != cdDisabled)) { _activeAppInf._isActivated = true; @@ -7591,6 +7591,21 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa } break; } + + case NPPM_ENABLECHECKDOCOPT: + { + NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI()); + if (wParam == CHECKDOCOPT_NONE) + nppgui._fileAutoDetection = cdDisabled; + else if (wParam == CHECKDOCOPT_UPDATESILENTLY) + nppgui._fileAutoDetection = cdAutoUpdate; + else if (wParam == CHECKDOCOPT_UPDATEGO2END) + nppgui._fileAutoDetection = cdGo2end; + else if (wParam == (CHECKDOCOPT_UPDATESILENTLY | CHECKDOCOPT_UPDATEGO2END)) + nppgui._fileAutoDetection = cdAutoUpdateGo2end; + + return TRUE; + } case WM_ACTIVATE : _pEditView->getFocus();