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

PATCH: vi-forward-char at end of buffer



It is supposed to be possible to combine l with keys like y, c and d to
cut the last character in the buffer. This fixes it.

Oliver

diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index 7312b3f..35e4193 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -599,7 +599,7 @@ vimatchbracket(UNUSED(char **args))
 int
 viforwardchar(char **args)
 {
-    int lim = findeol() - invicmdmode();
+    int lim = findeol() - invicmdmode() + virangeflag;
     int n = zmult;
 
     if (n < 0) {
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 507107e..d275372 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -10,6 +10,11 @@
 
 %test
 
+  zletest $'goox\ecld'
+0:change last character in buffer
+>BUFFER: good
+>CURSOR: 4
+
   zletest $'yankee doodle\ebhDyy0"1P'
 0:paste register 1 to get last deletion
 >BUFFER:  doodleyankee



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