From 0ed3c5ccd0caef397eae0cce9529cda65bf31be5 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Wed, 25 Sep 2013 18:42:59 +0100
Subject: 31765: If zle starts in viins mark as insertion. This allows undo to
work on everything entered.
---
Src/Zle/zle_main.c | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'Src')
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 756ff111a..5798e74b4 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1188,6 +1188,13 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
viinsbegin = 0;
statusline = NULL;
selectkeymap("main", 1);
+ /*
+ * If main is linked to the viins keymap, we need to register
+ * explicitly that we're now in vi insert mode as there's
+ * no user operation to indicate this.
+ */
+ if (openkeymap("main") == openkeymap("viins"))
+ viinsert(NULL);
selectlocalmap(NULL);
fixsuffix();
if ((s = getlinknode(bufstack))) {
--
cgit 1.4.1