Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] bracketed-paste: change quoting style



On Wed, Aug 12, 2015 at 12:09 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Make bracketed-paste use ''-quoting instead of \-quoting (when NUMERIC
> is nonzero).
>
> It's a bikeshed, of course, but I think '' is more readable.
>
> diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
> index 502e41e..5f2a580 100644
> --- a/Src/Zle/zle_misc.c
> +++ b/Src/Zle/zle_misc.c
> @@ -779,7 +779,7 @@ bracketedpaste(char **args)
>         int n;
>         ZLE_STRING_T wpaste;
>         wpaste = stringaszleline((zmult == 1) ? pbuf :
> -           quotestring(pbuf, NULL, QT_BACKSLASH), 0, &n, NULL, NULL);
> +           quotestring(pbuf, NULL, QT_SINGLE_OPTIONAL), 0, &n, NULL, NULL);
>         cuttext(wpaste, n, CUT_REPLACE);
>         if (!(zmod.flags & MOD_VIBUF)) {
>             kct = -1;

If we go here, we may as well allow the numeric to pick which quoting
style to use. :)

On a related note, someone on irc was confused about why
url-quote-magic stopped working in git, and it's of course because
bracketed pasting causes its self-insert hook to never run. We may
want to provide an alternative function to help with this case. (eg,
wrap bracketed-paste and quote if == http* or so.)

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author