From: Thomas Lauer <thomas.lauer@virgin.net>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: zle oddity or some option running wild?
Date: Thu, 27 Jun 2024 17:08:49 +0100 [thread overview]
Message-ID: <d63r7jh5lcleq5siufj95i80aih34k040p@tlc.com> (raw)
In-Reply-To: <1490409250.3766181.1719502910868@mail.virginmedia.com>
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
Date: Thu, 27 Jun 2024 16:41:50 +0100 (BST)
> > On 27/06/2024 16:19 BST Thomas Lauer <thomas.lauer@virgin.net> wrote:
> > From: Thomas Lauer <thomas.lauer@virgin.net>
> > Date: Wed, 26 Jun 2024 17:10:58 +0100
> >
> > > I have this in my zsh init:
> > > autoload -U select-word-style
> > > select-word-style shell
> >
> > I've now realised that these two commands interfere with almost every
> > widget I've written that copies/kills stuff from the command line.
>
> This is likely to be something to do with the "zle -f" stuff documented
> in the zshzle manual page --- getting kills and yanks from widgets to
> fit together nicely is a bit messy because they don't have the same
> knowledge about what's going on as builtin widgets.
>
> pws
Whatever the cause, select-word-style seems to change something globally
in a way that isn't helpful (to my use case).
But I've now cobbled together something that seems to do the job of
backward-kill-shell-word. A bit of a hack but seems to work:
backward-kill-shell-word() {
mark-or-kill
zle vi-backward-blank-word
mark-or-kill
}
with
mark-or-kill() {
if [[ $REGION_ACTIVE == 0 ]]; then
zle set-mark-command
else
zle set-mark-command -n -1
zle kill-region
fi
}
(I had the latter already defined as I use it for various other
widgets.)
So problem solved w/o select-word-style and lesson learned :-/
Thomas
next prev parent reply other threads:[~2024-06-27 16:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 16:10 Thomas Lauer
2024-06-26 16:38 ` Thomas Lauer
2024-06-27 15:19 ` Thomas Lauer
2024-06-27 15:41 ` Peter Stephenson
2024-06-27 16:08 ` Thomas Lauer [this message]
2024-06-28 4:35 ` Bart Schaefer
2024-06-28 13:48 ` Thomas Lauer
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=d63r7jh5lcleq5siufj95i80aih34k040p@tlc.com \
--to=thomas.lauer@virgin.net \
--cc=p.w.stephenson@ntlworld.com \
--cc=zsh-users@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).