From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10118 invoked by alias); 24 Jul 2015 05:21:58 -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: 35882 Received: (qmail 10332 invoked from network); 24 Jul 2015 05:21:57 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 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=1imhC3F5rBnNGDS4bLr9JRys/AxgZFuUZlsGaemSua4=; b=fXM+wwpxqo21mCx7zW0xZmvudeHoEBDKyxq1TpaAl4E6fN0nj6nsNDIhbSHiRbNL/L 8p0w8Ff3yuoF1PhQ3K4QrQIQttTXgd90jzQs+dr8hPcF64GBhKql2iHfrvHX3HxlVio+ JMKfdayWORTisj41oZiSNnp/36nICLF86R2oZWkzYK7WMVLt/KU3sZangfW21i4fEMAx zBoqQsGABFIUDZgyz0pWPOFuDttfj9OadKc/uT/98Rvp1SRnb2ZSmhajtXhuI2uUI2O8 Vckr8l0wBD29j6Dw0IgST1RKS/zylTVcEafPmrEXjWcoE9i6RP7x2oX5RTnSuwVoNWTK UiKw== X-Gm-Message-State: ALoCoQm7j4IE4R3HXfyvpu0AZSq8OVfHDbU/rIWPVCa7qTBPeF1KXIK4FJ6c4yvFuHebyd3n1ks0 X-Received: by 10.182.230.234 with SMTP id tb10mr13772145obc.23.1437715316288; Thu, 23 Jul 2015 22:21:56 -0700 (PDT) From: Bart Schaefer Message-Id: <150723222152.ZM18547@torch.brasslantern.com> Date: Thu, 23 Jul 2015 22:21:52 -0700 In-Reply-To: <150723220642.ZM18235@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: PATCH: highlight pasted text" (Jul 23, 10:06pm) References: <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> <485.1437632598@thecus.kiddle.eu> <150723220642.ZM18235@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: PATCH: highlight pasted text MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 23, 10:06pm, Bart Schaefer wrote: } } zle yank } zle -R } zle read-command && zle $REPLY That doesn't work with yank-pop, sadly, but can anyone point out a problem with this tiny patch? diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list index ebcf317..657e4ef 100644 --- a/Src/Zle/iwidgets.list +++ b/Src/Zle/iwidgets.list @@ -94,7 +94,7 @@ "quoted-insert", quotedinsert, ZLE_MENUCMP | ZLE_KEEPSUFFIX "quote-line", quoteline, 0 "quote-region", quoteregion, 0 -"read-command", readcommand, 0 +"read-command", readcommand, ZLE_NOTCOMMAND "recursive-edit", recursiveedit, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL "redisplay", redisplay, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL "redo", redo, ZLE_KEEPSUFFIX Then you can do: zle yank zle -R while zle read-command do # This looks odd but "zle $REPLY" might change $REPLY # so we have to test it before doing anything else if [[ $REPLY = (.|)yank-pop ]] then zle $REPLY else zle $REPLY break fi done Alternately, zle yank zle -R zle recursive-edit Of course that requires an extra accept-line to escape from the recursive-edit. You could fix that with some fancy keymap stuff passed with -K to recursive-edit, see Functions/Zle/keymap+widget for possible inspiration.