From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29091 invoked by alias); 4 Mar 2015 18:40: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: 34644 Received: (qmail 1728 invoked from network); 4 Mar 2015 18:40:06 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=D+ax8hga1VdJOJiSfDyP4JGq3OcZRMUorOGiHkIqveg=; b=OiTzO121Du+GiBmjJ2741C9fj4ck0sEIqFqJcXMHFWs+w6WEnlWtAlNDi7gC69EbHA KEu7frykuVGZO7ESdjr5wVNZrpfII6XPWToIjFf/KN2OzmT+E3k4mSkVn6HsXKbRdIyb YemY/vpSF5Iqm+b8rKnd3TP15SUZ5OEpVHfL3H67nfQcqy94L1cCGz5pKo1V4+WLaXtQ J5oT5a38B6Ud2vBqgVwvJl4PI3/hEmr5Gr7UsAutyQbgpD0gJeDzRuUKWOjF/Q45C5x3 wUN6/NH/7Lf5mw86/gXUcHp5wLw6GlHQukKJ+cMgjjZu4cLV7r6auJ4Ep0ioNqML6mGp OMpQ== MIME-Version: 1.0 X-Received: by 10.107.136.80 with SMTP id k77mr13701852iod.53.1425494403407; Wed, 04 Mar 2015 10:40:03 -0800 (PST) Date: Wed, 4 Mar 2015 19:40:03 +0100 Message-ID: Subject: PATCH: Don't store ZLE_LINE_ABORTED in vared context From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 The description of the parameter itself says ZLE_LINE_ABORTED This parameter is set by the line editor when an error occurs. It contains the line that was being edited at the point of the error. `print -zr -- $ZLE_LINE_ABORTED' can be used to recover the line. Only the most recent line of this kind is remembered. and the description of send-break says send-break (^G ESC-^G) (unbound) (unbound) Abort the current editor function, e.g. execute-named-command, or the editor itself, e.g. if you are in vared. Otherwise abort the parsing of the current line; in this case the aborted line is available in the shell variable ZLE_LINE_ABORTED. However, pressing ctrl-c inside vared stores whatever was being edited in ZLE_LINE_ABORTED, which the above seems to imply should not happen. The following adjusts the code accordingly. It was actually a bit annoying if you set up a widget to do the up-line-or-aborted, because it will grab the vared text as a command then. diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index f344ecc..5b1d5f9 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1252,7 +1252,7 @@ zleread(char **lp, zlecore(); - if (errflag) + if (errflag && zlecontext != ZLCON_VARED) setsparam("ZLE_LINE_ABORTED", zlegetline(NULL, NULL)); if (done && !exit_pending && !errflag) -- Mikael Magnusson