From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16192 invoked by alias); 23 Sep 2013 20:30:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31765 Received: (qmail 16741 invoked from network); 23 Sep 2013 20:30:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 80.0.253.75 as permitted sender) X-Originating-IP: [31.51.155.8] X-Spam: 0 X-Authority: v=2.0 cv=D70fsYtj c=1 sm=1 a=3BWpU5VZxw7riCwclHOsWQ==:17 a=iIMyAaQIY1QA:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=F2FXO287PvkA:10 a=pGLkceISAAAA:8 a=5PLoKwZF0_Aljwz3usEA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 a=3BWpU5VZxw7riCwclHOsWQ==:117 Date: Mon, 23 Sep 2013 21:30:14 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: zle: vi mode: wrong undo handling on fresh lines Message-ID: <20130923213014.15f97f9e@pws-pc.ntlworld.com> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 22 Sep 2013 14:37:25 +0200 Hauke Petersen wrote: > Insert operations should count as a single step in the undo history, > i.e. from command mode > > ifoou > > should effectively be a no-op. > > AFAICT, zsh handles this fine with the exception of fresh lines. Is it something like this, perhaps? diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 756ff11..5798e74 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))) { -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/