Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shift-Insert overwrites ZLE CUTBUFFER
- X-seq: zsh-users 22031
- From: lolilolicon <lolilolicon@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Shift-Insert overwrites ZLE CUTBUFFER
- Date: Thu, 27 Oct 2016 00:12:41 +0800
- Cc: 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=Ez8Hup2ql+ZE+OmWenoJS/ExRspUB+KugzKPWt8esB4=; b=vf9pZvL5Jrqmyoegk3USBhVjZW5AaP3h2HDK7TquxK5CaiQIttRvGjd2rQNEPRT0vH cdKoT8Kp8dggtmsmEix7JaLfEBnwVlBcC9zcfNfBS2/0WIKVISYcp7mheW0J3Bz2zAfl pFKgjBpCtVxAh2PsU7Jda4zAuN6IWIXDMwG7JStlH4yvWR+6ToxwH4s+wriQu9zGMaMx UKuMpOPIBViO+nXOW2Wvd+SmDkHMgpQxV4PnEbjxmX/EEO2Wkim5KUW/OOCyEsAixYSO cmcDodYeDwr1uXgH2fhhCDtKSzBdtvxvd/+WDx1CLYCRK0mNCmRt+pZnhDufZvEwqcVm KsVA==
- 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 Thu, Oct 27, 2016 at 12:01 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.
I assumed the kill ring was used for implementation convenience.
If this was a deliberate design decision, I don't understand how this
is desirable to the user.
This doesn't seem to be documented, so I think it's OK to change it.
>
> Something like this sort of works:
>
> my-bracketed-paste {
> zle .bracketed-paste "$@" && {
> local pasted=$CUTBUFFER
> # Swap the top two killed items to fake out ^Y
> CUTBUFFER=$killring[1]
> killring[1]=$pasted
> }
> }
> zle -N bracketed-paste my-bracketed-paste
>
> But I wouldn't have called that an "easy way".
Nice, thanks for showing me!
>
> Various other approaches involving saving/restoring CUTBUFFER and killring
> are also possible.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author