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

PATCH: fix vi visual range including blank final line



With a visual selection that has the cursor on the last line of the
buffer and where that line is empty, a yank would include the final null
character. This fixes it.

Oliver

diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 86840bd..953af24 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -255,7 +255,7 @@ getvirange(int wf)
     }
 
     /* visual selection mode needs to include additional position */
-    if (visual == 1 && invicmdmode())
+    if (visual == 1 && pos < zlell && invicmdmode())
 	INCPOS(pos);
 
     /* Was it a line-oriented move?  If so, the command will have set *



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