From f188d740438c6c6fc0b0312db270a2c9b4836887 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 25 Sep 2024 14:11:19 +0200 Subject: fixed rubbing out (some) string building constructs at the beginning of the command line argument * For instance, you can now rub out ^Q^W at the beginning of a string argument. Otherwise, pressing Ctrl+W after ^Q^W would rub out only the ^W. The next Ctrl+W would then insert ^W, due to special immediate editing inhibition after ^Q. * This still only works if the string building construct expanded to at least one byte. Suppose you have ^EQq, expanding to nothing, pressing Ctrl+W would chain to the default teco_state_process_edit_cmd() and the entire command would be rubbed out. This is probably tolerable. --- src/cmdline.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cmdline.c b/src/cmdline.c index d024142..232fb19 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -539,20 +539,15 @@ teco_state_stringbuilding_start_process_edit_cmd(teco_machine_stringbuilding_t * * get the default behaviour of teco_state_process_edit_cmd(). * This may not be a real-life issue serious enough to maintain * a result string even in parse-only mode. - * - * FIXME: Does not properly rubout string-building commands at the - * start of the string argument -- ctx->result->len is not - * a valid indicator of argument emptyness. - * Since it chains to teco_state_process_edit_cmd() we will instead - * rubout the entire command. */ if (ctx->result && ctx->result->len > 0) { gboolean is_wordchar = teco_string_contains(&wchars, teco_cmdline.str.data[teco_cmdline.effective_len-1]); teco_cmdline_rubout(); if (ctx->parent.current != current) { /* rub out string building command */ - while (ctx->result->len > 0 && ctx->parent.current != current) + do teco_cmdline_rubout(); + while (ctx->parent.current != current); return TRUE; } -- cgit v1.2.3