aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/search.c b/src/search.c
index 0875a9a..83e22ef 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1226,6 +1226,12 @@ teco_state_replace_insert_initial(teco_machine_main_t *ctx, GError **error)
return TRUE;
}
+static teco_state_t *
+teco_state_replace_insert_done(teco_machine_main_t *ctx, const teco_string_t *str, GError **error)
+{
+ return teco_state_insert_done(ctx, str, error);
+}
+
/*
* FIXME: Could be static
*/
@@ -1288,16 +1294,8 @@ TECO_DEFINE_STATE_SEARCH(teco_state_replace,
.expectstring.last = FALSE
);
-/*
- * FIXME: TECO_DEFINE_STATE_INSERT() already defines a done_cb(),
- * so we had to name this differently.
- * Perhaps it simply shouldn't define it.
- * Even better, we should perhaps avoid generating "required" callback
- * names (e.g. in TECO_DEFINE_STATE_EXPECTSTRING()) as it does more harm
- * than it helps and only spreads confusion.
- */
static teco_state_t *
-teco_state_replace_default_insert_done_overwrite(teco_machine_main_t *ctx, const teco_string_t *str, GError **error)
+teco_state_replace_default_insert_done(teco_machine_main_t *ctx, const teco_string_t *str, GError **error)
{
if (ctx->flags.mode > TECO_MODE_NORMAL)
return &teco_state_start;
@@ -1327,8 +1325,7 @@ teco_state_replace_default_insert_done_overwrite(teco_machine_main_t *ctx, const
* FIXME: Could be static
*/
TECO_DEFINE_STATE_INSERT(teco_state_replace_default_insert,
- .initial_cb = (teco_state_initial_cb_t)teco_state_replace_insert_initial,
- .expectstring.done_cb = teco_state_replace_default_insert_done_overwrite
+ .initial_cb = (teco_state_initial_cb_t)teco_state_replace_insert_initial
);
static teco_state_t *