diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2021-03-10 13:33:13 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2021-03-10 13:33:13 +1100 |
commit | 0ccb4e59e0551fd90dbda4ec3f8ad3e7c5d904ee (patch) | |
tree | bc9ee3fb830bf5dd04b0121385fcdb029291e88c /cocoa/ScintillaTest/AppController.mm | |
parent | aaceccdddd5d0a074a0ab76edb8738225c02d8b1 (diff) | |
download | scintilla-mirror-0ccb4e59e0551fd90dbda4ec3f8ad3e7c5d904ee.tar.gz |
Use Lexilla in ScintillaTest. Switch from ScintillaFramework to Scintilla.
Diffstat (limited to 'cocoa/ScintillaTest/AppController.mm')
-rw-r--r-- | cocoa/ScintillaTest/AppController.mm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cocoa/ScintillaTest/AppController.mm b/cocoa/ScintillaTest/AppController.mm index 7eeeea6eb..e7f96ed7d 100644 --- a/cocoa/ScintillaTest/AppController.mm +++ b/cocoa/ScintillaTest/AppController.mm @@ -106,9 +106,16 @@ const char user_keywords[] = // Definition of own keywords, not used by MySQL. - (void) setupEditor { // Lexer type is MySQL. - [mEditor setGeneralProperty: SCI_SETLEXER parameter: SCLEX_MYSQL value: 0]; - // alternatively: [mEditor setEditorProperty: SCI_SETLEXERLANGUAGE parameter: nil value: (sptr_t) "mysql"]; - + void *lexillaDL = dlopen(LEXILLA_LIB LEXILLA_EXTENSION, RTLD_LAZY); + if (lexillaDL) { + Lexilla::CreateLexerFn createLexer = + reinterpret_cast<Lexilla::CreateLexerFn>(dlsym(lexillaDL, LEXILLA_CREATELEXER)); + if (createLexer) { + Scintilla::ILexer5 *pLexer = createLexer("mysql"); + [mEditor setReferenceProperty: SCI_SETILEXER parameter: nil value: pLexer]; + } + } + // Keywords to highlight. Indices are: // 0 - Major keywords (reserved keywords) // 1 - Normal keywords (everything not reserved but integral part of the language) |