Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shift-Insert overwrites ZLE CUTBUFFER
- X-seq: zsh-users 22032
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, lolilolicon@xxxxxxxxx
- Subject: Re: Shift-Insert overwrites ZLE CUTBUFFER
- Date: Thu, 27 Oct 2016 00:05:13 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zFb342WIzTN2rpsEEsbP3FL41v/558sKdebH9vvVUek=; b=rPEOF0LWoNZG34q99miWEdWknuOG+nzmaIkCwMoiUD4UVzAriyasi1Cx5m9ZYUORow LU2soNFlpgRcrBowyPAaryJIzmMnPGANa2yuqwFNQFAeig7/Y5lP676HPpBX4fAZLtBW xlq+Z4MpS7ILG0LvlGERu/eUoiDYjrPvwvcqtYXEwcs2mN23rSkp9F+qCiGqUXKd5jzQ 38Azc0GxfjazRid49k2l+g222LWGKY7e/O9Ic768CF7l6gvKPDBZ1h6u4zYgeSmMjcuG qRNnF+WeqvX5EOv1d9N+W0rMIkno3GxLL9L4Puw8Yl9iuGZpuScubG1E/vULYGv140PZ JLcg==
- In-reply-to: <161026090133.ZM11120@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAMtVo_PG_fd62V1FZ4r7fRUragzzS6H4McN5sO1=hhY=6DR6Yg@mail.gmail.com> <161025091249.ZM7232@torch.brasslantern.com> <CAMtVo_N6qOQr++Amzn11+m3pkOxjc908mwFUerur77+OWd92uw@mail.gmail.com> <161026090133.ZM11120@torch.brasslantern.com>
On Wed, Oct 26, 2016 at 6:01 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Oct 26, 12:28am, lolilolicon wrote:
> } Subject: Re: Shift-Insert overwrites ZLE CUTBUFFER
> }
> } On Wed, Oct 26, 2016 at 12:12 AM, Bart Schaefer
> } <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } > There's currently no easy way to change the cutbuffer behavior without
> } > disabling the rest of the bracketed-paste behavior.
> }
> } That's a shame.
> } Is it technically difficult to do? Would there be an issue if zsh just
> } popped the killring automatically?
>
> What I mean is that it's not easy to do from shell code. In the source
> code obviously the implementation is deliberately pushing the kill ring,
> so it wouldn't be technically difficult to *not* do so, but that would
> mean reversing an earlier design decision.
Actually if you pass a parameter name to the bracketed-paste widget,
it stuffs the pasted content in there and does literally nothing else.
So a simple wrapper widget that doesn't mess with the yank buffer
could look like this:
my-bracketed-paste () {
local wantquote=${NUMERIC:-0}
local content
zle .$WIDGET -N content
if (( $wantquote == 1 )); then
content=${(q-)content}
fi
LBUFFER+=$content
}
Or if you don't care about quoting the input ever, just
my-bracketed-paste () {
local content
zle .$WIDGET -N content
LBUFFER+=$content
}
(see also the bracketed-paste-url-magic function distributed with zsh)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author