aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/search.c11
-rw-r--r--src/symbols.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/src/search.c b/src/search.c
index 3b2ebe3..13fb135 100644
--- a/src/search.c
+++ b/src/search.c
@@ -45,7 +45,11 @@ typedef struct {
teco_buffer_t *from_buffer, *to_buffer;
} teco_search_parameters_t;
-TECO_DEFINE_UNDO_OBJECT_OWN(parameters, teco_search_parameters_t, /* don't delete */);
+/* FIXME: Could be static. */
+TECO_DEFINE_UNDO_SCALAR(teco_search_parameters_t);
+
+#define teco_undo_search_parameters(VAR) \
+ (*teco_undo_object_teco_search_parameters_t_push(&(VAR)))
/*
* FIXME: Global state should be part of teco_machine_main_t
@@ -99,7 +103,7 @@ teco_state_search_initial(teco_machine_main_t *ctx, GError **error)
teco_machine_stringbuilding_set_codepage(&ctx->expectstring.machine,
teco_interface_get_codepage());
- teco_undo_object_parameters_push(&teco_search_parameters);
+ teco_undo_search_parameters(teco_search_parameters);
teco_search_parameters.dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0);
teco_int_t v1, v2;
@@ -538,6 +542,7 @@ teco_pattern2regexp(teco_string_t *pattern, teco_machine_qregspec_t *qreg_machin
return g_steal_pointer(&re.data) ? : g_strdup("");
}
+/* FIXME: Could be static. */
TECO_DEFINE_UNDO_OBJECT_OWN(ranges, teco_range_t *, g_free);
#define teco_undo_ranges_own(VAR) \
@@ -944,7 +949,7 @@ teco_state_search_all_initial(teco_machine_main_t *ctx, GError **error)
teco_machine_stringbuilding_set_codepage(&ctx->expectstring.machine,
teco_interface_get_codepage());
- teco_undo_object_parameters_push(&teco_search_parameters);
+ teco_undo_search_parameters(teco_search_parameters);
teco_search_parameters.dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0);
teco_int_t v1, v2;
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)) ||