diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-16 11:40:52 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-10-16 11:40:52 +0300 |
commit | d714bb48a4b8629f6345a28bc21a24537207176b (patch) | |
tree | d605b57c182741590377edae8ced7e693000523d /src/core-commands.c | |
parent | d556aee67e615b48c25861741d28d103109235e3 (diff) | |
download | sciteco-d714bb48a4b8629f6345a28bc21a24537207176b.tar.gz |
fixup: use teco_machine_t::must_undo instead of trying to identify the current state machine
* The previous solution was not wrong, but unnecessarily complex. We already have a flag
for exactly this purpose.
* Avoid redundancies by introducing teco_machine_stringbuilding_set_codepage().
Diffstat (limited to 'src/core-commands.c')
-rw-r--r-- | src/core-commands.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core-commands.c b/src/core-commands.c index befb6e8..0cde7e0 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -2759,12 +2759,9 @@ teco_state_insert_initial(teco_machine_main_t *ctx, GError **error) /* * Current document's encoding determines the behaviour of * string building constructs. - * - * NOTE: This is not safe to undo in macro calls. */ - if (ctx == &teco_cmdline.machine) - teco_undo_guint(ctx->expectstring.machine.codepage); - ctx->expectstring.machine.codepage = teco_interface_get_codepage(); + teco_machine_stringbuilding_set_codepage(&ctx->expectstring.machine, + teco_interface_get_codepage()); if (!teco_expressions_eval(FALSE, error)) return FALSE; |