From d7330f252e6b0a1326eac6b5fc0b219a7b706eb7 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 26 Dec 2025 01:04:11 +0100 Subject: TECO_DEFINE_STATE_INSERT() no longer generates a done_cb This made problems in teco_state_replace_default_insert, where we had to override the done_cb. Perhaps we should avoid all generated callback names (ie. mandatory callback implementations)? --- src/core-commands.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/core-commands.h') diff --git a/src/core-commands.h b/src/core-commands.h index 4cc8747..8f8966f 100644 --- a/src/core-commands.h +++ b/src/core-commands.h @@ -88,14 +88,9 @@ gboolean teco_state_insert_process_edit_cmd(teco_machine_main_t *ctx, teco_machi * @ingroup states * * @note Also serves as a base class of the replace-insertion commands. - * @fixme Generating the done_cb could be avoided if there simply were a default. + * @note You must always define a done_cb(). */ #define TECO_DEFINE_STATE_INSERT(NAME, ...) \ - static teco_state_t * \ - NAME##_done(teco_machine_main_t *ctx, const teco_string_t *str, GError **error) \ - { \ - return teco_state_insert_done(ctx, str, error); \ - } \ TECO_DEFINE_STATE_EXPECTSTRING(NAME, \ .initial_cb = (teco_state_initial_cb_t)teco_state_insert_initial, \ .process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t)teco_state_insert_process_edit_cmd, \ @@ -103,7 +98,7 @@ gboolean teco_state_insert_process_edit_cmd(teco_machine_main_t *ctx, teco_machi ##__VA_ARGS__ \ ) -TECO_DECLARE_STATE(teco_state_insert_plain); +TECO_DECLARE_STATE(teco_state_insert); TECO_DECLARE_STATE(teco_state_insert_indent); /** -- cgit v1.2.3