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

[PATCH 1/2] Fix vi-rev-repeat-find after vi-find-*-char-skip



When vi-rev-repeat-find (,) is used to repeat either
vi-find-next-char-skip (t) or vi-find-prev-char-skip (T), the direction
in which the final cursor location will be adjusted needs to be reversed
along with the direction of the search.  If this is not done, the
reverse find will go past the desired character rather than stopping
before it.

Examples of behaviour ([] indicates cursor position):

Previously:

       Completion/Un[i]x/Command/_ls
    t/ Completion/Uni[x]/Command/_ls
    ,  Completio[n]/Unix/Command/_ls

       Completion/Un[i]x/Command/_ls
    T/ Completion/[U]nix/Command/_ls
    ,  Completion/Unix/[C]ommand/_ls

Now:

       Completion/Un[i]x/Command/_ls
    t/ Completion/Uni[x]/Command/_ls
    ,  Completion/[U]nix/Command/_ls

       Completion/Un[i]x/Command/_ls
    T/ Completion/[U]nix/Command/_ls
    ,  Completion/Uni[x]/Command/_ls
---
 Src/Zle/zle_move.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index 0e940bc..284a863 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -770,9 +770,11 @@ virevrepeatfind(char **args)
 	zmult = -zmult;
 	return ret;
     }
+    tailadd = -tailadd;
     vfinddir = -vfinddir;
     ret = virepeatfind(args);
     vfinddir = -vfinddir;
+    tailadd = -tailadd;
     return ret;
 }
 
-- 
1.7.10.4



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