From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24344 invoked by alias); 31 Jan 2014 21:43:16 -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: 32333 Received: (qmail 23208 invoked from network); 31 Jan 2014 21:43:09 -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=1391204242; bh=By6B6cQ6eMdQ1vuDpNOg5Egei7+zkOOXfBwWIt1YPWw=; 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:Date:Message-ID; b=fTx9CD3QkNty5xdiTCijvqjW4CCbdar32uASmY2GHefwGB9/eEezjHTjusB5CnY8JPCDyrwfKBRAva7YeRaC2jwjhzToZfww0o4KQ0G5zCLZ0CfqMCzmQyKex0ND/Tm9P2Oj66mhsfa7X9UxefIVvSg428DxI3RuOIbnFjiQKxw= X-Yahoo-Newman-Id: 139584.79723.bm@smtp102.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: x7pe66EVM1mMqI.yRB2BQQ7hsMIZB6_rpf7_NkODl68xxHN 05GtNATxXb9nOA3JDCLeln49GOz6LNGEYg0YWnh80_g.7HFjQOej0C4SunmT DxVemhnQmnUCQg1q2RFgTzV7R3.JMudlVPhZSFs1V.nE1B7RVLQGuOtAeFgh nJu3S0A4ODHHGvuob1XZCPwYiNkYpdJY3fWMIVWggxP8cgVITiE81fsVvOoF Jewf0qaH7V_FvFxz1yDYRVpWPtWxnNgEPclABQ776G07GRoHL7SPHGljAOzf JHwrxtUosyQX8qNeGxDF2ejMML2VdC1lFaQZSh1I4p6YdSOZc.6RQxZXX07T R4ln2D_8bm3slH7a5jXFqXZZqFM9rvNwETAD0Gm3DsTWzhgxM1Ll19PekwbC 0imEfm20UZPICBSsz8.N8jfM1LWP1p7EhViZRnFIY.rk6gMAOq2466ufzevE t2LT.T4BT7o_09RVypS2On_fTwO3ZUPsF8NRW3kVEmkrWKFHn9O1easc8RI3 AOFDEDeAQyJovncfMsJpdClHJLLU- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-Rocket-Received: from kiddle.eu (okiddle@95.222.210.25 with plain [188.125.69.59]) by smtp102.mail.ir2.yahoo.com with SMTP; 31 Jan 2014 21:37:22 +0000 UTC In-reply-to: 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> To: zsh-workers@zsh.org Subject: Re: zle: vi mode: wrong undo handling on fresh lines Date: Fri, 31 Jan 2014 22:37:20 +0100 Message-ID: <19068.1391204240@thecus.kiddle.eu> I sent this earlier but it hasn't arrived so resending. Sorry if it appears twice. "Jun T." wrote: > This is my "trial" to (somewhat) improve the behavior of 'undo' after completion. > The patch below is against (git-HEAD)+(patch in 32314 by Oliver Kiddle). > The change in zle_tricky.c is to start a new undo-block when entering a > completion. I hate to be negative bit if we now split the undo block at all the points where someone prefers it split. We'll end up back in the situation Hauke Petersen complained about in September. It is also not easy to recombine them. How about we instead add a split-undo zle widget? It is then easy for someone to add that before completion or other widgets like backward-delete-word. I like the fact that a vi undo will now undo a whole change but I'm used to using the emacs mode undo key to revert a completion. Also, as I mentioned before, completion in vim doesn't split the undo. > The change in zle_main.c is to make 'undo' no to bring back the suffix added > by completion but erased when going back to the command mode. I'm fairly convinced that we should handle the suffix with the simple patch below. I've long had vi-cmd-mode set to first use auto-suffix-retain. I could be wrong but would suspect most vi users would prefer it this way. However, it'd be good to have the opinion of another vi-mode user. What do you think? > (This will also change the behavior in emacs-mode.) I can't quite work out what the emacs-mode behaviour change is. Oliver PS. I have now committed 32314. I've put some tests together but will hold off on posting to them until we've finalised the behaviour. I looked at merging Felix's zle tests but as he basically indicates in the e-mail, he wasn't really finished. A number of his tests fail and I haven't been able to work out why. diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list index 4372fe3..0e4c479 100644 --- a/Src/Zle/iwidgets.list +++ b/Src/Zle/iwidgets.list @@ -125,7 +125,7 @@ "vi-change", vichange, 0 "vi-change-eol", vichangeeol, 0 "vi-change-whole-line", vichangewholeline, 0 -"vi-cmd-mode", vicmdmode, 0 +"vi-cmd-mode", vicmdmode, ZLE_KEEPSUFFIX "vi-delete", videlete, ZLE_KILL | ZLE_KEEPSUFFIX "vi-delete-char", videletechar, ZLE_KEEPSUFFIX "vi-digit-or-beginning-of-line", vidigitorbeginningofline, 0