aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/symbols.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-21 13:21:02 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-03-21 13:21:02 +0300
commit121cca61bedf24ba428e019f23b3bbb7160ce162 (patch)
tree9d506201de777693583fc7939ee8a31ca8fd1a17 /src/symbols.c
parent7f1a83e606d0ec766ef3c0ca4830ca47cc1fe867 (diff)
downloadsciteco-121cca61bedf24ba428e019f23b3bbb7160ce162.tar.gz
don't use TECO_DEFINE_UNDO_OBJECT_OWN() for what are essentially scalars
* The "own" objects are tricky to work with and have special requirements, so try to avoid them. * Also, wrap the push functions in macros like all other scalars. * This is a purely cosmetic change, but avoids some confusion.
Diffstat (limited to 'src/symbols.c')
-rw-r--r--src/symbols.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/symbols.c b/src/symbols.c
index 7dcc601..52dfd1f 100644
--- a/src/symbols.c
+++ b/src/symbols.c
@@ -43,10 +43,11 @@
teco_symbol_list_t teco_symbol_list_scintilla = {NULL, 0};
teco_symbol_list_t teco_symbol_list_scilexer = {NULL, 0};
-/*
- * FIXME: Could be static.
- */
-TECO_DEFINE_UNDO_OBJECT_OWN(scintilla_message, teco_machine_scintilla_t, /* don't delete */);
+/* FIXME: Could be static. */
+TECO_DEFINE_UNDO_SCALAR(teco_machine_scintilla_t);
+
+#define teco_undo_scintilla_message(VAR) \
+ (*teco_undo_object_teco_machine_scintilla_t_push(&(VAR)))
/** @memberof teco_symbol_list_t */
void
@@ -222,7 +223,7 @@ teco_state_scintilla_symbols_done(teco_machine_main_t *ctx, const teco_string_t
* undo methods for the Scintilla types.
*/
if (ctx->parent.must_undo)
- teco_undo_object_scintilla_message_push(&ctx->scintilla);
+ teco_undo_scintilla_message(ctx->scintilla);
memset(&ctx->scintilla, 0, sizeof(ctx->scintilla));
if ((str->len > 0 && !teco_scintilla_parse_symbols(&ctx->scintilla, str, error)) ||