From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5284 invoked by alias); 14 Oct 2017 18:40:31 -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: List-Unsubscribe: X-Seq: 41897 Received: (qmail 22773 invoked by uid 1010); 14 Oct 2017 18:40:31 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.52):SA:0(-1.4/5.0):. Processed in 1.901159 secs); 14 Oct 2017 18:40:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: mh.codebro@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FxpezxK4AEPpDAs3j5OuoZs2e7JDPYz7XZzddbocwz8=; b=u3s4pMpSVqS4TAtUPcXMD82vW1rXyrd9BPpD351yGaMb74h0W8x097wU7XhVhx+V5F 0SGSMEsmUc0RMZq/xYkux8vWIH42HZS3aBYktIxHeYl7Ef+puNWzw5HmPKMyUi4kBKGu wC1f6u2svxwav4VcQ07N2HDeMeTHE2XJNw1gahQ7b4DBb3nBxJZQetk2x2SsXK05NDC9 pnwR0+1Rei7vtkwVXOoJha2yfShWpHevpPcADZe60OXgls4L54mqwvvZ6Ev4bg6J8wF/ UtRWSxbBLUHvmTdWNCvZObn5nnaW9aAHiGaI0rk8ZqJy11GrJ7Q6+Dts/UByUPfPWw1E PMtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FxpezxK4AEPpDAs3j5OuoZs2e7JDPYz7XZzddbocwz8=; b=BGA3aunavUHH7Lyz/Lqz2MMZAdZuisWYdU6HfAnTjGuVr9XISN/saA/ThlsFfMrVTr 15JguKY4bEtXcsGingsLqd4zKsTf5Goj3IYroI8M3KeREqT40643VwvvHaAfGHBOnTmm /2x2gs11YqifbIiZfN/NgwUkrDuMa/7ehjeIoxu3jz6SCRkxlQ6U4Yw+kK6kRTlcsUtC 6CiOdbWCMA69YSohwwCqMiVsyCjI1eWi3bUK9cNtb4j2omiDVbEvzJ1qvrqdpFlLPsLG a0jSHafv/bFGNhrx8+CsjU8jP6YUc3tx1D4tVHbzkfZTDrVh06Rp+WC6c/6p34Q9cqIX FnGQ== X-Gm-Message-State: AMCzsaW1vVLWXiHuPKzjQ/3b+fwWX1mA4GptwUO0f7EwFhBEpXMf4k/t eYnJTdZbMPs4gxBykCLmuqB36wUZ X-Google-Smtp-Source: AOwi7QCMBzKQ+a1v3Dg2wnU/ZnbBV4sq/+2nfuSJ328u338M87Ui+3Vf0Buu3SEIUPvP15gFguYUDQ== X-Received: by 10.80.144.105 with SMTP id z38mr6848069edz.185.1508006425938; Sat, 14 Oct 2017 11:40:25 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.0 \(3445.1.7\)) Subject: Re: [PATCH] edit-command-line breaks arguments with spaces From: Marco Hinz In-Reply-To: <171013175555.ZM12982@torch.brasslantern.com> Date: Sat, 14 Oct 2017 20:40:24 +0200 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <376287AE-22B0-4642-9A9E-A86414157E1D@gmail.com> References: <4B40504C-14CC-4EE0-8A53-5CF67C67E37E@gmail.com> <1507939677.3717869.1138301848.03470D9F@webmail.messagingengine.com> <171013175555.ZM12982@torch.brasslantern.com> To: Bart Schaefer X-Mailer: Apple Mail (2.3445.1.7) > Wouldn't this work and be preferable to eval? >=20 > diff --git a/Functions/Zle/edit-command-line = b/Functions/Zle/edit-command-line > index 353f260..f77eb35 100644 > --- a/Functions/Zle/edit-command-line > +++ b/Functions/Zle/edit-command-line > @@ -15,15 +15,15 @@ > (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2] >=20 > # Open the editor, placing the cursor at the right place if we know = how. > - local editor=3D${${VISUAL:-${EDITOR:-vi}}} > + local editor=3D(${(Q)${(z)${VISUAL:-${EDITOR:-vi}}}}) > case $editor in=20 > (*vim*) > integer byteoffset=3D$(( $#PREBUFFER + $#LBUFFER + 1 )) > - ${=3Deditor} -c "normal! ${byteoffset}go" -- $1;; > + ${editor} -c "normal! ${byteoffset}go" -- $1;; > (*emacs*) > local lines=3D( ${(f):-"$PREBUFFER$LBUFFER"} ) > - ${=3Deditor} +${#lines}:$((${#lines[-1]} + 1)) $1;; > - (*) ${=3Deditor} $1;; > + ${editor} +${#lines}:$((${#lines[-1]} + 1)) $1;; > + (*) ${editor} $1;; > esac >=20 > (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1] Oh, wow. Splitting words but taking quoted arguments into account.. I = was looking for something like (z). The patch works well and I'd prefer that approach.