zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: Zle widgets for vi-mode word motion: patch and a question
Date: Mon, 18 Dec 2017 20:05:55 +0900	[thread overview]
Message-ID: <E8CFB4A7-1DD5-4196-AEB4-ADE0A683C5F6@kba.biglobe.ne.jp> (raw)
In-Reply-To: <21671458-6017-48A0-B90E-D33CF207F81B@kba.biglobe.ne.jp>

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)




      reply	other threads:[~2017-12-18 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 13:01 Jun T
2017-12-18 11:05 ` Jun T [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E8CFB4A7-1DD5-4196-AEB4-ADE0A683C5F6@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).