aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cmdline.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-25 14:11:19 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-25 14:11:19 +0200
commitf188d740438c6c6fc0b0312db270a2c9b4836887 (patch)
tree6d4b9532cbeaf88b759367a882199b5fad8f524d /src/cmdline.c
parentdcaeb77ef2c5fad1810d242d7a96669e33c4b082 (diff)
downloadsciteco-f188d740438c6c6fc0b0312db270a2c9b4836887.tar.gz
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.
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c9
1 files 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;
}