about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_vi.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f58749919..35081c284 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-04-14  Oliver Kiddle  <opk@zsh.org>
 
+	* 38287: Src/Zle/zle_vi.c: fix position for the end of a visual
+	selection range for the cursor on an empty last line in the buffer
+
 	* 38286: Src/Zle/zle_misc.c: cursor correction following
 	yank-pop is only applicable to vi command mode
 
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 86840bdd6..953af2401 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 *