From 427092d2c8ee11b4a56eb50dbf68861f10f2a81f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 27 Oct 2024 19:51:10 +0300 Subject: fixed rubbing out <:Xq>, <:^Uq> and other append-to-register operations * This was a regression introduced in 41ab5cf0289dab60ac1ddc97cf9680ee2468ea6c, which changed the semantics of teco_doc_undo_set_string(). * Removed undo_append_string() Q-Reg virtual method. append_string() now does its own undo token emission, so that we can defer the teco_doc_undo_edit() after the point that the document was initialized. This is important, so that we can configure the default encoding on new registers. --- src/qreg-commands.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/qreg-commands.c') diff --git a/src/qreg-commands.c b/src/qreg-commands.c index 5b80d15..6fb68f2 100644 --- a/src/qreg-commands.c +++ b/src/qreg-commands.c @@ -408,8 +408,7 @@ teco_state_setqregstring_nobuilding_done(teco_machine_main_t *ctx, if (colon_modified) { /* append to register */ - if (!qreg->vtable->undo_append_string(qreg, error) || - !qreg->vtable->append_string(qreg, buffer, len, error)) + if (!qreg->vtable->append_string(qreg, buffer, len, error)) return NULL; } else { /* set register */ @@ -422,8 +421,7 @@ teco_state_setqregstring_nobuilding_done(teco_machine_main_t *ctx, if (args > 0 || colon_modified) { /* append to register */ - if (!qreg->vtable->undo_append_string(qreg, error) || - !qreg->vtable->append_string(qreg, str->data, str->len, error)) + if (!qreg->vtable->append_string(qreg, str->data, str->len, error)) return NULL; } else { /* set register */ @@ -790,8 +788,7 @@ teco_state_copytoqreg_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg, teco_interface_ssm(SCI_GETTEXTRANGEFULL, 0, (sptr_t)&range); if (teco_machine_main_eval_colon(ctx)) { - if (!qreg->vtable->undo_append_string(qreg, error) || - !qreg->vtable->append_string(qreg, str, len, error)) + if (!qreg->vtable->append_string(qreg, str, len, error)) return NULL; } else { guint cp = teco_interface_get_codepage(); -- cgit v1.2.3