Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: $NUMERIC from a vi widget
- X-seq: zsh-workers 35092
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: $NUMERIC from a vi widget
- Date: Tue, 12 May 2015 22:42:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1431463365; bh=FvoNOgCLL3/K3kbx2OtmqVgkzjkk0u62PYA7H557kko=; h=From:To:Subject:Date:From:Subject; b=M5Yzf4SVVTpvtDAZt6w70FHBLC01x+O0r9PFTHvVa1KmKX+BliMj7fxl+wP1sa9F45+zW2m8SW5Yi0X4M6F8UjTW10Z3g0MJaJoo9gQkvUnWLesQQ1pEYBKPkgGj4aMXG9RZx7B/pUIC2KKrtz/oun48Krt2WAaxZsK2ZCOmkwxhgkW4N9BG7WVM5LPUgBaKU7frDHFCPWhuuJUsVXAcneEf7nZ2WxDZZioM+6HskOHtheEtkunTgxZoKvkXCeS7blOv4KhjLUDNTqyJMMrwWEfpD3yPdJCrdW7ThoNBT/JEe639r6RTmqQbVhxakJ5u9rdB54hqBzCY0PxPct7qfQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I noticed that numeric arguments were not working from vi operation
pending mode if the subsequent operation was a shell function based
widget. It seems $NUMERIC was simply unset. The following patch fixes it
but I'm not entirely sure that I've fully understood what is going on
here and why this is only affecting shell functions in that case. Is
there some other more fundamental cause perhaps?
To reproduce:
three() { CURSOR=${NUMERIC:-3} }
zle -N three
bindkey -a '|' three
Then, use a command like d7| on a long line. Note that 7d| works.
Oliver
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index dc5fed4..ce4b072 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -173,7 +173,7 @@ makezleparams(int ro)
pm->base = 10;
break;
}
- if ((zp->type & PM_UNSET) && (zmod.flags & MOD_MULT))
+ if ((zp->type & PM_UNSET) && (zmod.flags & (MOD_MULT|MOD_TMULT)))
pm->node.flags &= ~PM_UNSET;
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author