PATCH: don't start a vi change from emacs mode

Oliver Kiddle <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
If put-replace-change is used from emacs mode, it starts a vi change.
This is mostly harmless, or at least was before this was used by the
terminal cursor changing to tell vi mode apart from emacs mode. This
patch makes this conditional.

vi-backward-delete-char also has a similar condition. Most widgets in
zle_vi.c don't but I can't see much else that would warrant it.

Oliver

diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 3e50d5d4b..b17270b51 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -685,7 +685,8 @@ putreplaceselection(UNUSED(char **args))
     int clear = 0;
     int pos = 2;
 
-    startvichange(-1);
+    if (invicmdmode())
+	startvichange(-1);
     if (n < 0 || zmod.flags & MOD_NULL)
 	return 1;
     if (zmod.flags & MOD_OSSEL) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.