diff options
| author | mitchell <unknown> | 2020-05-26 14:21:43 -0400 | 
|---|---|---|
| committer | mitchell <unknown> | 2020-05-26 14:21:43 -0400 | 
| commit | d5ca0474b5e15091b94c01f878e251f4263b9192 (patch) | |
| tree | 75ee6fc299c3448d92443e8a01f793a655123866 /lexers/LexLPeg.cxx | |
| parent | 213decc706fe2576efeddb68aa280c37d858f3ec (diff) | |
| download | scintilla-mirror-d5ca0474b5e15091b94c01f878e251f4263b9192.tar.gz | |
Added SCI_PRIVATELEXERCALL API for retrieving the style number of a style name.
Diffstat (limited to 'lexers/LexLPeg.cxx')
| -rw-r--r-- | lexers/LexLPeg.cxx | 12 | 
1 files changed, 9 insertions, 3 deletions
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<sptr_t>(arg);      switch(code) {      case SCI_GETDIRECTFUNCTION: -      SS = reinterpret_cast<SciFnDirect>(lParam); +      SS = reinterpret_cast<SciFnDirect>(arg);        return nullptr;      case SCI_SETDOCPOINTER:        sci = lParam;        return nullptr;      case SCI_CHANGELEXERSTATE:        if (ownLua) lua_close(L); -      L = reinterpret_cast<lua_State *>(lParam), ownLua = false; +      L = reinterpret_cast<lua_State *>(arg), ownLua = false;        return nullptr;      case SCI_LOADLEXERLIBRARY: {        const char *path = reinterpret_cast<const char*>(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<void *>(STYLE_DEFAULT); +      for (int i = 0; i < STYLE_MAX; i++) +        if (strcmp(NameOfStyle(i), reinterpret_cast<const char *>(arg)) == 0) +          return reinterpret_cast<void *>(i); +      return reinterpret_cast<void *>(STYLE_DEFAULT); +    case SCI_GETSTATUS:        return StringResult(lParam, props.Get(LexerErrorKey));      }      return nullptr;  | 
