zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Subject: Re: Undo is confused after push-line-or-edit?
Date: Fri, 03 Jul 2015 14:24:10 +0200	[thread overview]
Message-ID: <5772.1435926250@thecus.kiddle.eu> (raw)
In-Reply-To: <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


      reply	other threads:[~2015-07-03 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03  3:09 Bart Schaefer
2015-07-03 12:24 ` Oliver Kiddle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5772.1435926250@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).