From 39249ed57170f09e7dd2fc76c62b51d90a2a4d76 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 27 Jun 2025 16:13:15 +0200 Subject: fixed ^S/^Y for and * We must call teco_interface_bytes2glyphs() only ever with byte offsets that already exist in the buffer. * regression, introduced in aaa1d51a4c85fcc627e88ef7cf5292d9c5f5f840 --- src/qreg-commands.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/qreg-commands.c') diff --git a/src/qreg-commands.c b/src/qreg-commands.c index 0457e92..7189771 100644 --- a/src/qreg-commands.c +++ b/src/qreg-commands.c @@ -535,9 +535,6 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre return NULL; sptr_t pos = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); - teco_undo_int(teco_ranges[0].from) = teco_interface_bytes2glyphs(pos); - teco_undo_int(teco_ranges[0].to) = teco_interface_bytes2glyphs(pos + str.len); - teco_undo_guint(teco_ranges_count) = 1; if (str.len > 0) { teco_interface_ssm(SCI_BEGINUNDOACTION, 0, 0); @@ -549,6 +546,10 @@ teco_state_getqregstring_got_register(teco_machine_main_t *ctx, teco_qreg_t *qre undo__teco_interface_ssm(SCI_UNDO, 0, 0); } + teco_undo_int(teco_ranges[0].from) = teco_interface_bytes2glyphs(pos); + teco_undo_int(teco_ranges[0].to) = teco_interface_bytes2glyphs(pos + str.len); + teco_undo_guint(teco_ranges_count) = 1; + return &teco_state_start; } -- cgit v1.2.3