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.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index e756eab..faf1c48 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -643,7 +643,7 @@ teco_state_start_input(teco_machine_main_t *ctx, gunichar chr, GError **error) ['"'] = {&teco_state_condcommand}, ['E'] = {&teco_state_ecommand, .modifier_at = TRUE, .modifier_colon = 2}, - ['I'] = {&teco_state_insert_plain, + ['I'] = {&teco_state_insert, .modifier_at = TRUE}, ['?'] = {&teco_state_help, .modifier_at = TRUE}, @@ -2962,7 +2962,7 @@ teco_state_insert_done(teco_machine_main_t *ctx, const teco_string_t *str, GErro * may be better, since it has string building characters * disabled. */ -TECO_DEFINE_STATE_INSERT(teco_state_insert_plain); +TECO_DEFINE_STATE_INSERT(teco_state_insert); static gboolean teco_state_insert_indent_initial(teco_machine_main_t *ctx, GError **error) @@ -2995,6 +2995,12 @@ teco_state_insert_indent_initial(teco_machine_main_t *ctx, GError **error) return TRUE; } +static teco_state_t * +teco_state_insert_indent_done(teco_machine_main_t *ctx, const teco_string_t *str, GError **error) +{ + return teco_state_insert_done(ctx, str, error); +} + /* * Alternatives: ^i, ^I, , */ -- cgit v1.2.3