Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Undo is confused after push-line-or-edit?
- X-seq: zsh-workers 35674
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Undo is confused after push-line-or-edit?
- Date: Fri, 03 Jul 2015 14:24:10 +0200
- 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==
- In-reply-to: <150702200951.ZM10806@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <150702200951.ZM10806@torch.brasslantern.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author