From 9e101ec36e0bf45f294f63015e0352d1d08d641d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 23 Mar 2025 18:31:09 +0300 Subject: the ES command (send Scintilla message) now supports passing both wParam and lParam as null-terminated strings * Being able to embed null bytes into the lParam string is practically useless - there aren't any messages where this is useful and where there are no native SciTECO counterparts - so this case is now catched and the null-byte separates wParam from lParam. * wParam can be the empty string, but it is not supported to pass wParam as a string and lParam as the empty string. If the second string argument ends in ^@, lParam is popped from the stack instead. * This is a temporary workaround until we can properly parse the Scintilla.iface and generate more elegant per-message wrappers. * It in particular unlocks the SCI_SETREPRESENTATION and SCI_SETPROPERTY messages. The former allows us to write a special hex-editor macro which sets hexadecimal character representations, while the latter allows you to set lexer properties. * The C-based lexers ("cpp" in Lexilla) can now take preprocessor definitions into account. This is disabled by default, unless you set lexer.c.defines before opening a file. You can also set it interactively and re-set the lexer. For instance: ^U[lexer.c.defines]NDEBUG$ M[lexer.set.c] --- src/lexer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lexer.c') diff --git a/src/lexer.c b/src/lexer.c index 1124b99..84ddcc3 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -133,9 +133,9 @@ teco_lexer_step(teco_view_t *view, teco_machine_main_t *machine, * The curly braces will be styled like regular commands. * * FIXME: This will not work with nested macro definitions. - * FIXME: This cannot currently be disabled since SCI_SETPROPERTY - * cannot be accessed with ES. - * We could only map it to an ED flag. + * FIXME: This cannot currently be disabled, not even with SCI_SETPROPERTY. + * We could only map it to an ED flag or + * rewrite the lexer against the ILexer5 interface, which requires C++. */ if ((escape_char == '{' || machine->expectstring.machine.escape_char == '{') && teco_view_ssm(view, SCI_GETPROPERTYINT, (uptr_t)"lexer.sciteco.macrodef", TRUE)) -- cgit v1.2.3