From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15971 invoked by alias); 28 Jan 2014 16:29:04 -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: 32311 Received: (qmail 2427 invoked from network); 28 Jan 2014 16:28:57 -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 From: Bart Schaefer Message-id: <140128082834.ZM21167@torch.brasslantern.com> Date: Tue, 28 Jan 2014 08:28:34 -0800 In-reply-to: <20140128145847.7204df4e@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: zle: vi mode: wrong undo handling on fresh lines" (Jan 28, 2:58pm) References: <20130923213014.15f97f9e@pws-pc.ntlworld.com> <3511.1390605547@thecus.kiddle.eu> <140125111530.ZM21792@torch.brasslantern.com> <20140127124301.4144f2d9@pwslap01u.europe.root.pri> <20140127161124.2aa16b37@pwslap01u.europe.root.pri> <20140128145847.7204df4e@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: zle: vi mode: wrong undo handling on fresh lines MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 28, 2:58pm, Peter Stephenson wrote: } } > I think this is starting to get somewhere, but I suspect it needs } > tweaking. For example, should that synthesised 'i' really be an 'a'? } } Well, I think I'm going to commit it with the "a" because (i) this } definitely seems better than what was there before in any case and (ii) } hitting "ESC" and "." after typing the start of the line, which is my } naive way of getting it to repeat, does repeat what I just inserted } because of vi's quirk of backing up a character when leaving insert } mode. Obviously I'm not claiming this is the end of the matter. Sorry, I missed this when looking at your previous message. I agree that "a" is more correct than "i" here. In fact "A" might even be a reasonable choice. Another thing to check is the interaction of this with push-line. Is the right thing done if the buffer isn't empty when entering ZLE? } > Is it OK to assume we're not in insert mode when vi-repeat is executed? Wow, good question. vi-repeat is implemented by replaying (a subset of) the input keystrokes, not the widget actions they are bound to ... } > If it's not safe, I don't understand how it ever worked. If someone were to bind vi-repeat to a keystroke in the viins keymap, I imagine the wrong thing would happen and always has. Yep, just now confirmed this. If that's a bug, it's not a directly related one. } I'm not hearing much in the way of knowledgeable direction for the } completion issue. It probably needs some hook trying out to see } if it works. I'm not familiar enough with the undo mechanics to make and good stabs at such a hook, I fear.