From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11549 invoked by alias); 12 Jan 2016 07:53:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37574 Received: (qmail 24180 invoked from network); 12 Jan 2016 07:53:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=M8zrXf/xhPozlQ/nsGgu+WyXcp8joHCV/lCJa/qjJ/I=; b=0JhkSooZuW46dL6XqskTalSPs1pD7w3gI7WrX/NzlXZ+7M1GYP4uFk9vfmfPAcGsHw lMb3ilbBI/4wgw+Aup6cG++oKN57miDKkTdmeIluYszewN9bRF1oqYJyXoP3SGloHs7n WdSzRxVOKJAqIIKdlqZAHb1qQgR8iRuLCAUfFBsCFQcvwmKO+JbPzmXOiw6KOiggJynn x9aoPpY8LWo5mYw4KF+7Je3urqHyEHwezgEPkOwm73XlmQ95CkiDZN6NU9yN0Z6HnvTF 93LNjPEKWVDhZpx9P4WoFOBj8Kh0MC5JBsFtWQ8auxoUa9M1zZDHmYWGTyyFtmEp5eIj puyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=M8zrXf/xhPozlQ/nsGgu+WyXcp8joHCV/lCJa/qjJ/I=; b=blLlwtK6nG4CPVDOBRkOOC/2KRuyfkHaaQ7IxyMU3Gl0AIRYU5jncRUodCMCTz1Aea jtE+tFeZvRrukbzArSeYhenoWu+kQxktFmDxlYgn+F+hkXFtxvGwXLFCUSTEzKzdexBK 3nfAE2wX/F95M8ZSY/Z9THqjSEqyEcWY8xp8UsFDR7qCCDbPSvO47xUWcBEfiAYkowq2 X0MBmtiwdiTMCQJoNIQBwD+Dgw3iuN7HmkqKLc9noqG98dqePInQfjtpBcZV4U/gLFKw a/1GmDvoS+Ixt0jqag+JyVBf6L6XAXNcsJhsjFlKtXxn6Mc8x2jEzna4HBq/JNZvyZ+g Glew== X-Gm-Message-State: ALoCoQkVTYbCBE+yHJiPqMlrGATMwD+mQ8TgpD+MXq9l2wix80BXbD96d+W9nOYmJAMK8TtaWlKS56y57o0tT/Z+ZO2nI12qGQ== X-Received: by 10.98.42.213 with SMTP id q204mr32676372pfq.141.1452585234990; Mon, 11 Jan 2016 23:53:54 -0800 (PST) From: Bart Schaefer Message-Id: <160111235409.ZM6788@torch.brasslantern.com> Date: Mon, 11 Jan 2016 23:54:09 -0800 In-Reply-To: <20160110195323.GA23064@tarsus.local2> Comments: In reply to Daniel Shahaf "Re: backward-kill-shell-word widget" (Jan 10, 7:53pm) References: <20160110003758.GA28696@tarsus.local2> <160110091744.ZM585@torch.brasslantern.com> <20160110195323.GA23064@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: backward-kill-shell-word widget MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jan 10, 7:53pm, Daniel Shahaf wrote: } } Bart Schaefer wrote on Sun, Jan 10, 2016 at 09:17:44 -0800: } > } > backward-kill-shell-word() { } > zle select-in-shell-word } > ((++CURSOR)) # adjust for vi vs. emacs region } > zle kill-region } } I'd add: } LBUFFER+=" " } } Without that, LBUFFER[-1] after the widget is the last character of the } preceding word. If you don't kill the space, select-in-shell-word won't identify the correct word on a repeated call. Other problems I've noted with this approach are that multiple calls add to the kill ring but do not append to CUTBUFFER, and that this kills the whole word under the cursor not just the part to the left. So it needs some work.