zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: $NUMERIC from a vi widget
@ 2015-05-12 20:42 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2015-05-12 20:42 UTC (permalink / raw)
  To: Zsh workers

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;
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-12 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 20:42 PATCH: $NUMERIC from a vi widget Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).