From 0ccb4e59e0551fd90dbda4ec3f8ad3e7c5d904ee Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Wed, 10 Mar 2021 13:33:13 +1100 Subject: Use Lexilla in ScintillaTest. Switch from ScintillaFramework to Scintilla. --- cocoa/ScintillaTest/AppController.mm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cocoa/ScintillaTest/AppController.mm') 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(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) -- cgit v1.2.3