From a53fa85dabdfc2c47ec0c9e6626ddda2379a8e38 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 25 Jul 2026 02:37:17 +0200 Subject: get rid of teco_qreg_vtable_t::undo_set_integer() It was never required as a separate callback/method, but was kept merely for consistency. Since we now call teco_current_doc_set_dot() in teco_qreg_dot_set_integer(), we'd have to split it up into an "undo" method as well. I decided to get rid of the superfluous Q-Reg method instead. It's quite likely we could get rid of the remaining undo_set_string(), undo_exchange_string() and undo_edit() callbacks as well (TODO). --- src/qreg.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/qreg.h') diff --git a/src/qreg.h b/src/qreg.h index c0f95db..ca35e78 100644 --- a/src/qreg.h +++ b/src/qreg.h @@ -47,18 +47,19 @@ extern teco_view_t *teco_qreg_view; * teco_qreg_set_integer(qreg, 23, error); * * But this probably won't work. Perhaps use the X-macro pattern. + * + * FIXME: We can probably get rid of all the separate undo callbacks/methods. */ typedef const struct { + /* already pushes undo tokens */ gboolean (*set_integer)(teco_qreg_t *qreg, teco_int_t value, GError **error); - /** @fixme We don't appear to need this as a separate callback */ - gboolean (*undo_set_integer)(teco_qreg_t *qreg, GError **error); gboolean (*get_integer)(teco_qreg_t *qreg, teco_int_t *ret, GError **error); gboolean (*set_string)(teco_qreg_t *qreg, const gchar *str, gsize len, guint codepage, GError **error); gboolean (*undo_set_string)(teco_qreg_t *qreg, GError **error); - /* does not need an explicit undo-call */ + /* already pushes undo tokens */ gboolean (*append_string)(teco_qreg_t *qreg, const gchar *str, gsize len, GError **error); gboolean (*get_string)(teco_qreg_t *qreg, gchar **str, gsize *len, -- cgit v1.2.3