From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13132 invoked by alias); 29 Jan 2014 10:56:52 -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: 32317 Received: (qmail 7307 invoked from network); 29 Jan 2014 10:56:45 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1390992619; bh=/2ILlHkYQ4asxr3dezrzOFkSCdkPEC2KlzaWZwSW/yo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=Xu6hD4r6DJlsbyb31ph/GrEzYq3UL69rgb/du82YaM/WOPBMOCLPFpklOe7SCmHf6UqRVdn261m71udPqcUt/YHlOxGJ+prVwjte9anwnYZwQxWMUAEkQfQAPo5iYk+T4EjBHYhqiD9gAjTk7Jv9La/LjMgHN42BeKCtwVVAiaw= X-Yahoo-Newman-Id: 567716.23465.bm@smtp142.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3fLXyJsVM1kgItqmc3eZe.nmy82DtDPoloHD.3Kl8oIc8lU seOj4LOSBDBTiFktThn5qId8J9GKtCl3dEjV8HjZzWK8EpGIeiEO.fOs985i dljQQdmz2G4o52uzFfLL_OfwxDtMdCGS7xpMmYMhcoo.Qf3JeqHHpMvRm.xs J0wVnoMqKHYjCSh1RAjQC49AHBme4GaMsmWHG13HEw2GzI7c4IcFqt76Avzn Ma6OU7A3ACEbt6nHifx3d8Ol2Q2Ga2tlSly2_T7HBkY.SRn65l2iEZjMfUNV .lgyoyDIxp_wLKz2eDXiB106wmfATcP7jifT4LIxAzeL_aEW3Y3AY45keYu9 57RnFnCTJ6tOmQbovRArkcZy3MA7R0..yOOIzkWg1AmqaeHsJNn3wcDSTIrV i.M5E8leVl3qHgranhH.B6VvZZu1r9bHFaJsHa_JgSRZj4K18IYgz6XsRDs_ PVDLANM_SbMtRxuk7_eMuksyyw9IS3LY8yJmrpzm7SJXx0QIgKbtVtG2lVW9 kxKka_FDqSbYOzcUqNo56kzsC X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@88.153.4.83 with plain [188.125.69.59]) by smtp142.mail.ir2.yahoo.com with SMTP; 29 Jan 2014 10:50:19 +0000 UTC In-reply-to: <140128185946.ZM21512@torch.brasslantern.com> From: Oliver Kiddle 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> <2700.1390950035@thecus.kiddle.eu> <140128185946.ZM21512@torch.brasslantern.com> 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" Content-ID: <4755.1390992582.1@thecus.kiddle.eu> Date: Wed, 29 Jan 2014 11:50:13 +0100 Message-ID: <4757.1390992613@thecus.kiddle.eu> Bart wrote: > On Jan 29, 12:00am, Oliver Kiddle wrote: > } depends on the cursor position. If the cursor starts at the > } beginning of the line then 'i' makes more sense. It occurs to me that for a blank line 'o' is just as valid as either 'i' or 'a' but possibly more useful. > } > Is it OK to assume we're not in insert mode when vi-repeat is executed? > Actually it does more than beep; with -- Having played with this in various combinations, I think we should just start virepeatchange() with: if (!invicmdmode()) return 1; Unless someone can be bothered to make it do something useful. > This sounds fine to me, and wouldn't have been possible prior to the > numbering of undo events. Is there a well-defined place where a user > defined widget could read $UNDO_CHANGE_NO and be sure it was the same > as the internal vistartchange value? Logically, reading it from within zle-keymap-select would do that except UNDO_CHANGE_NO doesn't seem to be set in there. That would provide a roundabout way to get at the contents of viinsbegin from a widget. > One doc example for zle-line-init still implies you can get into vi > command mode by "zle -K vicmd". (This even moves one character left > when switching from viins to vicmd; I'm not sure how/where the code > that does that is being called.) That does skip the code I added and some other vi-change related code but I'm somewhat inclined to think it should stay that way to allow more control from a zle widget. It would seem odd for zle -K to have extra side-effects. The cursor repositioning is probably necessary, however. Oliver