Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: $NUMERIC from a vi widget



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