From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24153 invoked by alias); 3 Jul 2015 12:31:09 -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: 35674 Received: (qmail 19806 invoked from network); 3 Jul 2015 12:31:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1435926252; bh=s/Q3yy2PxrRznMaWX80R09dIB3cP3ie57IJdWpU1bi0=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=VcDeU++EV3BcKq93zILTtvWeAv1lKLIEXQqZc+hcR9d5M9Frg+xWDeU9yUdf8jLJ3FWemLjdbVDe71hwMNC9P7POrUhbbLRP2uxoJhURW6MBPkqnKMsyPtMD1gfX68B8V2wH4M1Rc9A0gR2aLXCq44AXTrc4l6TbnGAd3tcXkZk6Df4hEaVqy+oD/WeWqRaNOCVa+rqfpynDPpAEJrpx9SH8nYVo0LtZRBtNp4fwf3eyZhmcG0tuhs46v7Pu9UTovlPwjxXdOBA91F7lk2axQKQiRAwvZ2xasT1ZJZEwr/rTDDr41fpsjgCTYwEHqxKNNLt8WjoVmrXEU7h8DTffBg== X-Yahoo-Newman-Id: 905352.56625.bm@smtp117.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: GVmfevEVM1ngpCOCc7JdmiiX3XIYVwDLjNlIfGc7EvYdTdl UJf5EfFWt5OBmhuUqZyxodjm3LLSefywz3Cb9xDE427JSo0tLV1I2X_PAsRm aR0idHnFKcBJ_8F.y5v5OI6uapnqgMxST7zUnUkZBtlrWyyEhdCWSi3izpZ5 o9.8gz0sGgipTtUNrd1X07ow.XJLNwJ0ISwgjE1KRRfc55bCM.EkMDieuFiS b_3DGQLpoMCMy3KcO5icmRzSkjY1hcGVdHeyHjuj1NB3Iky3CcwR2vjEhX3n xKnI7MeJLYm9P0j2d7TQaAMwy42ZMb2TkvbRylgGCQ4Qjk7MRTD5e3ECRDSx xqVx_MClblgQ_K0YmgDSFlLBEiWqBi24LN0ARGr7YWI8v6N4e1DaRaTBh5OA Laou4EXqdiJ51HL8.00iJlXKWAgnlPLzso4gEunNafLhrHinw71lQEenFszw ng.X4yESFk7jUY6Pcn3FuBd9U_YqBGMI_ra.Gtbq73q.5iQuctu4hE6MFZsQ d3MuhjlKq.5W8mjncuIC6ct7Gf8hzlg-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <150702200951.ZM10806@torch.brasslantern.com> From: Oliver Kiddle References: <150702200951.ZM10806@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: Undo is confused after push-line-or-edit? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5771.1435926250.1@thecus.kiddle.eu> Date: Fri, 03 Jul 2015 14:24:10 +0200 Message-ID: <5772.1435926250@thecus.kiddle.eu> Bart wrote: > Now ctl-x ctl-u erases everything, when I would have expected it to put > back the "stuff". If you do more than one editing action, you can repeat > the undo back as far as the the second one, but the first one is always > skipped and the entire buffer erased instead. > > Incorrect initialization of undo_changeno ? Missing mkundoent()? After getting a line from the buffer stack, it should create an undo entry. I can get similar effects with a simple print -z. This does somewhat complicate the trick of creating undo entries from zle-line-init if you want them to precede the initial buffer: you need to start with zle undo and add another split-undo with an empty buffer before restoring the buffer. Oliver diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index fe561fc..c13e3a0 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1206,6 +1206,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish) histline = stackhist; stackhist = -1; } + handleundo(); } /* * If main is linked to the viins keymap, we need to register