mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-09-25 10:58:18 +02:00
Add NPPM_CREATELEXER message for plugins to instantiate lexers
Fix #11789, close #11790
This commit is contained in:
parent
f69a9093f9
commit
f1ed4de78d
@ -540,6 +540,9 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
|
|||||||
// Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character),
|
// Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character),
|
||||||
// allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string.
|
// allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string.
|
||||||
|
|
||||||
|
#define NPPM_CREATELEXER (NPPMSG + 110)
|
||||||
|
// void* NPPN_CREATELEXER(0, const TCHAR *lexer_name)
|
||||||
|
// Returns the ILexer pointer created by Lexilla
|
||||||
|
|
||||||
#define VAR_NOT_RECOGNIZED 0
|
#define VAR_NOT_RECOGNIZED 0
|
||||||
#define FULL_CURRENT_PATH 1
|
#define FULL_CURRENT_PATH 1
|
||||||
@ -734,4 +737,3 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
|
|||||||
//scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG;
|
//scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG;
|
||||||
//scnNotification->nmhdr.hwndFrom = hwndNpp;
|
//scnNotification->nmhdr.hwndFrom = hwndNpp;
|
||||||
//scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t
|
//scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t
|
||||||
|
|
||||||
|
@ -1386,6 +1386,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
return cmdLineString.length();
|
return cmdLineString.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_CREATELEXER:
|
||||||
|
{
|
||||||
|
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
|
||||||
|
const char* lexer_name = wmc.wchar2char(reinterpret_cast<TCHAR*>(lParam), CP_ACP);
|
||||||
|
return (LRESULT) CreateLexer(lexer_name);
|
||||||
|
}
|
||||||
|
|
||||||
case WM_FRSAVE_INT:
|
case WM_FRSAVE_INT:
|
||||||
{
|
{
|
||||||
_macro.push_back(recordedMacroStep(static_cast<int32_t>(wParam), 0, lParam, NULL, recordedMacroStep::mtSavedSnR));
|
_macro.push_back(recordedMacroStep(static_cast<int32_t>(wParam), 0, lParam, NULL, recordedMacroStep::mtSavedSnR));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user