zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fix vi visual range including blank final line
@ 2016-04-13 21:04 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2016-04-13 21:04 UTC (permalink / raw)
  To: Zsh workers

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 *


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-13 21:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 21:04 PATCH: fix vi visual range including blank final line Oliver Kiddle

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).