diff options
author | Neil <nyamatongwe@gmail.com> | 2019-12-13 12:07:44 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-12-13 12:07:44 +1100 |
commit | 314bba00774e663ac6bf4c00e36393e2c191fbaf (patch) | |
tree | 6bc53e710e17e6ed759b607ebd2f14f2aebcb70e /src/ExternalLexer.cxx | |
parent | eab0c872c43486e670cb0157f83910982e3ad10b (diff) | |
download | scintilla-mirror-314bba00774e663ac6bf4c00e36393e2c191fbaf.tar.gz |
Move automatic numbering of external lexers from Catalogue to ExternalLexer.
This is preparing to move much of Catalogue into a header for reuse.
Diffstat (limited to 'src/ExternalLexer.cxx')
-rw-r--r-- | src/ExternalLexer.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ExternalLexer.cxx b/src/ExternalLexer.cxx index 495b8a867..1609b676e 100644 --- a/src/ExternalLexer.cxx +++ b/src/ExternalLexer.cxx @@ -35,6 +35,8 @@ using namespace Scintilla; namespace { +int nextLanguage = SCLEX_AUTOMATIC + 1; + typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); typedef LexerFactoryFunction(EXT_LEXER_DECL *GetLexerFactoryFunction)(unsigned int Index); @@ -138,7 +140,9 @@ LexerLibrary::LexerLibrary(const char *moduleName_) { // Assign a buffer for the lexer name. char lexname[100] = ""; GetLexerName(i, lexname, sizeof(lexname)); - ExternalLexerModule *lex = new ExternalLexerModule(SCLEX_AUTOMATIC, nullptr, lexname, nullptr); + ExternalLexerModule *lex = new ExternalLexerModule(nextLanguage, nullptr, lexname, nullptr); + nextLanguage++; + // This is storing a second reference to lex in the Catalogue as well as in modules. // TODO: Should use std::shared_ptr or similar to ensure allocation safety. Catalogue::AddLexerModule(lex); |