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

Re: Zle widgets for vi-mode word motion: patch and a question



Sorry, I've found a simple bug in my previous patch (fixed by the last hunk
in the patch below).

I also noticed that, in a few widgets, wrong functions were called for
negative numeric argument (the first three hunks).


diff --git a/Src/Zle/zle_word.c b/Src/Zle/zle_word.c
index 4910d765b..89959b20c 100644
--- a/Src/Zle/zle_word.c
+++ b/Src/Zle/zle_word.c
@@ -86,7 +86,7 @@ viforwardword(char **args)
     if (n < 0) {
 	int ret;
 	zmult = -n;
-	ret = backwardword(args);
+	ret = vibackwardword(args);
 	zmult = n;
 	return ret;
     }
@@ -168,7 +168,7 @@ viforwardblankwordend(char **args)
     if (n < 0) {
 	int ret;
 	zmult = -n;
-	ret = viforwardblankwordend(args);
+	ret = vibackwardblankwordend(args);
 	zmult = n;
 	return ret;
     }
@@ -276,7 +276,7 @@ vibackwardword(char **args)
     if (n < 0) {
 	int ret;
 	zmult = -n;
-	ret = backwardword(args);
+	ret = viforwardword(args);
 	zmult = n;
 	return ret;
     }
@@ -482,7 +482,7 @@ vibackwardkillword(UNUSED(char **args))
 	    cc = wordclass(zleline[pos]);
 	    for (;;) {
 		x = pos;
-		if (x < lim)
+		if (x <= lim)
 		    break;
 		DECPOS(pos);
 		if (wordclass(zleline[pos]) != cc)





Messages sorted by: Reverse Date, Date, Thread, Author