Subject: Re: bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic)
From: Bart Schaefer <[email-masked]>
To: [email-masked]
Date: Mon, 9 May 2016 08:41:43 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On May 9,  4:13pm, Vincent Lefevre wrote:
} Subject: Re: bracket-paste-magic adds backslashes inside a quoted string i
}
} On 2016-05-08 11:50:26 -0700, Bart Schaefer wrote:
} > You want
} > 
} >     zstyle :bracketed-paste-magic paste-init backward-extend-paste
} > 
} > so that the quote marks that are already on the line are treated as
} > part of the pasted text.
} 
} Shouldn't this be the default behavior?

We had quite a bit of discussion on related topics when bracketed-paste
was added.  The general idea is that a paste is treated as a unit, and
the default behavior of bracketed-paste-magic is to restrict its action
to remain "inside" that unit.

backward-extend-paste is appropriate when bracketed-paste-magic combines
with url-quote-magic, but not necessarily so in other cases.  paste-init
(and paste-finish) can be used for this kind of thing generically; the
backward-extend action is included by default, but has to be turned on.