summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-08-22 21:50:31 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-08-22 21:50:31 -0700
commit1cfe4ca1926bc2c8041290bb0d8c3dccf8662f52 (patch)
tree835a9e3b3a32bfe6ed89a9652fc3c8b8d71bcc49
parent2ed3b84fa65b949bfea8895ab287011042fae8fb (diff)
downloadzsh-1cfe4ca1926bc2c8041290bb0d8c3dccf8662f52.tar.gz
zsh-1cfe4ca1926bc2c8041290bb0d8c3dccf8662f52.tar.xz
zsh-1cfe4ca1926bc2c8041290bb0d8c3dccf8662f52.zip
36273: teach endofline() and endoflinehist() about invicmdmode() cursor placement.
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_move.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f9ccf8e3..1cc9ff1ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-22  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 36273: Src/Zle/zle_move.c: teach endofline() and endoflinehist()
+	about invicmdmode() cursor placement.
+
 2015-08-21  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* unposted: Config/version.mk, Src/parse.c, Src/Zle/zle_misc.c:
diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index f49df8647..155fda80d 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -344,6 +344,8 @@ endofline(char **args)
 	    zlecs = zlell;
 	    return 0;
 	}
+	if ((zlecs += invicmdmode()) == zlell)
+	    break;
 	if (zleline[zlecs] == '\n')
 	    if (++zlecs == zlell)
 		return 0;
@@ -414,6 +416,8 @@ endoflinehist(char **args)
 	    zlecs = zlell;
 	    break;
 	}
+	if ((zlecs += invicmdmode()) == zlell)
+	    break;
 	if (zleline[zlecs] == '\n')
 	    if (++zlecs == zlell)
 		break;