zsh-workers
 help / color / mirror / code / Atom feed
From: Marco Hinz <mh.codebro@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] edit-command-line breaks arguments with spaces
Date: Sun, 15 Oct 2017 16:15:10 +0200	[thread overview]
Message-ID: <73BD54B7-C461-498E-B120-F9E2B0DA6587@gmail.com> (raw)
In-Reply-To: <171014183503.ZM20596@torch.brasslantern.com>

Perfect!

> The following seems to be the full set of agreed-upon changes.
> 
> 
> diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
> index 353f260..e17893e 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]
> 
>   # Open the editor, placing the cursor at the right place if we know how.
> -  local editor=${${VISUAL:-${EDITOR:-vi}}}
> +  local editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" )
>   case $editor in 
>     (*vim*)
>       integer byteoffset=$(( $#PREBUFFER + $#LBUFFER + 1 ))
> -      ${=editor} -c "normal! ${byteoffset}go" -- $1;;
> +      "${(@)editor}" -c "normal! ${byteoffset}go" -- $1;;
>     (*emacs*)
> -      local lines=( ${(f):-"$PREBUFFER$LBUFFER"} )
> -      ${=editor} +${#lines}:$((${#lines[-1]} + 1)) $1;;
> -    (*) ${=editor} $1;;
> +      local lines=( "${(@f):-"$PREBUFFER$LBUFFER"}" )
> +      "${(@)editor}" +${#lines}:$((${#lines[-1]} + 1)) $1;;
> +    (*) "${(@)editor}" $1;;
>   esac
> 
>   (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1]


      reply	other threads:[~2017-10-15 14:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 23:05 Marco Hinz
2017-10-14  0:07 ` Daniel Shahaf
2017-10-14  0:45   ` Marco Hinz
2017-10-14  0:55   ` Bart Schaefer
2017-10-14  1:52     ` Daniel Shahaf
2017-10-14  4:21       ` Phil Pennock
2017-10-14 13:57         ` Daniel Shahaf
2017-10-14  1:56     ` Daniel Shahaf
2017-10-14 18:40     ` Marco Hinz
2017-10-15  1:35       ` Bart Schaefer
2017-10-15 14:15         ` Marco Hinz [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=73BD54B7-C461-498E-B120-F9E2B0DA6587@gmail.com \
    --to=mh.codebro@gmail.com \
    --cc=schaefer@brasslantern.com \
    --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).