diff options
-rw-r--r-- | lib/lexers/sciteco.tes | 2 | ||||
-rw-r--r-- | src/symbols.c | 11 | ||||
-rw-r--r-- | src/view.c | 11 |
3 files changed, 13 insertions, 11 deletions
diff --git a/lib/lexers/sciteco.tes b/lib/lexers/sciteco.tes index 058e79d..129b150 100644 --- a/lib/lexers/sciteco.tes +++ b/lib/lexers/sciteco.tes @@ -8,7 +8,7 @@ } @[lexer.set.sciteco]{ - ESSETILEXERsciteco + 1ESSETIDENTIFIER !*:M[color.keyword],1M[color.set]*! :M[color.operator],2M[color.set] :M[color.variable],3M[color.set] diff --git a/src/symbols.c b/src/symbols.c index 798b89c..944d01d 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -321,13 +321,8 @@ teco_state_scintilla_lparam_done(teco_machine_main_t *ctx, const teco_string_t * sptr_t lParam = 0; - if (ctx->scintilla.iMessage == SCI_SETILEXER && - !teco_string_cmp(str, "sciteco", 7)) { - /* perform lexing in the container (see teco_lexer_style()) */ - lParam = 0; - } #ifdef HAVE_LEXILLA - else if (ctx->scintilla.iMessage == SCI_SETILEXER) { + if (ctx->scintilla.iMessage == SCI_SETILEXER) { if (teco_string_contains(str, '\0')) { g_set_error_literal(error, TECO_ERROR, TECO_ERROR_FAILED, "Lexer name must not contain null-byte."); @@ -341,9 +336,9 @@ teco_state_scintilla_lparam_done(teco_machine_main_t *ctx, const teco_string_t * "Lexilla lexer \"%s\" not found.", lexer); return NULL; } - } + } else #endif - else if (str->len > 0) { + if (str->len > 0) { /* * NOTE: There may even be messages that read strings * with embedded nulls. @@ -645,7 +645,14 @@ teco_view_process_notify(teco_view_t *ctx, SCNotification *notify) g_printf("SCINTILLA NOTIFY: code=%d\n", notify->nmhdr.code); #endif - if (notify->nmhdr.code == SCN_STYLENEEDED) - /* Lexing in the container: only used for SciTECO */ + /* + * Lexing in the container: only used for SciTECO. + * + * The "identifier" is abused to enable/disable lexing. + * It could be extended later on for several internal lexers. + * The alternative would be an ILexer5 wrapper, written in C++. + */ + if (notify->nmhdr.code == SCN_STYLENEEDED && + teco_view_ssm(ctx, SCI_GETIDENTIFIER, 0, 0) != 0) teco_lexer_style(ctx, notify->position); } |