aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cmdline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index 25b7b98..3fb7cb9 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -456,6 +456,14 @@ teco_state_process_edit_cmd(teco_machine_t *ctx, teco_machine_t *parent_ctx, gun
*/
if (teco_cmdline.modifier_enabled) {
/* reinsert command */
+ /* @ and : are not separate states, but practically belong to the command */
+ while (ctx->current->is_start &&
+ teco_cmdline.effective_len < teco_cmdline.str.len &&
+ (teco_cmdline.str.data[teco_cmdline.effective_len] == ':' ||
+ teco_cmdline.str.data[teco_cmdline.effective_len] == '@'))
+ if (!teco_cmdline_rubin(error))
+ return FALSE;
+
do {
if (!teco_cmdline_rubin(error))
return FALSE;
@@ -481,6 +489,13 @@ teco_state_process_edit_cmd(teco_machine_t *ctx, teco_machine_t *parent_ctx, gun
teco_cmdline_rubout();
while (!ctx->current->is_start);
+ /* @ and : are not separate states, but practically belong to the command */
+ while (ctx->current->is_start &&
+ teco_cmdline.effective_len > 0 &&
+ (teco_cmdline.str.data[teco_cmdline.effective_len-1] == ':' ||
+ teco_cmdline.str.data[teco_cmdline.effective_len-1] == '@'))
+ teco_cmdline_rubout();
+
return TRUE;
#if !defined(INTERFACE_GTK) && defined(SIGTSTP)