From d5ca0474b5e15091b94c01f878e251f4263b9192 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 26 May 2020 14:21:43 -0400 Subject: Added SCI_PRIVATELEXERCALL API for retrieving the style number of a style name. --- lexers/LexLPeg.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lexers') diff --git a/lexers/LexLPeg.cxx b/lexers/LexLPeg.cxx index a34b10fda..60626fd3b 100644 --- a/lexers/LexLPeg.cxx +++ b/lexers/LexLPeg.cxx @@ -806,14 +806,14 @@ public: auto lParam = reinterpret_cast(arg); switch(code) { case SCI_GETDIRECTFUNCTION: - SS = reinterpret_cast(lParam); + SS = reinterpret_cast(arg); return nullptr; case SCI_SETDOCPOINTER: sci = lParam; return nullptr; case SCI_CHANGELEXERSTATE: if (ownLua) lua_close(L); - L = reinterpret_cast(lParam), ownLua = false; + L = reinterpret_cast(arg), ownLua = false; return nullptr; case SCI_LOADLEXERLIBRARY: { const char *path = reinterpret_cast(arg); @@ -858,7 +858,13 @@ public: } val.append(val, 0, val.length() - 1); // "lexer/lexer" fallback return StringResult(lParam, val.c_str()); - } case SCI_GETSTATUS: + } case SCI_GETNAMEDSTYLES: + if (!L) return reinterpret_cast(STYLE_DEFAULT); + for (int i = 0; i < STYLE_MAX; i++) + if (strcmp(NameOfStyle(i), reinterpret_cast(arg)) == 0) + return reinterpret_cast(i); + return reinterpret_cast(STYLE_DEFAULT); + case SCI_GETSTATUS: return StringResult(lParam, props.Get(LexerErrorKey)); } return nullptr; -- cgit v1.2.3