From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2389 invoked by alias); 13 Aug 2015 23:23:17 -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: 36155 Received: (qmail 10681 invoked from network); 13 Aug 2015 23:23:14 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=S5xefvH216op9lXhErApotj+AYU=; b=Mv70to 9XKmR8Bh/gl2BqE3t16A4WQJXPoTIawLPoBrnly2DusSznL1J4MzyQSM5OhFKsa+ +bmjxqnG4znLjntr37B+G5TJzYfBb2JpheSSxxibvpiciOIE28EvJOcsYLhim5wb U8BXarRjasISgy2jtOOnf2xtu5Tk5PfthqNfw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=S5xefvH216op9lXhErApotj+AYU=; b=pDZ4m VzyyfUgk9RluapGwrDsf16GrLEhjuiXkNKeMA/xLDmZHwEgdfXg+leFVFFzfm6/P 8oYDpVAhvDNMnQWQ7rNA3hj6FV5xDzofF1ssq3vBo2ZvNtLJEYwLWBPD77+gnuL7 W1so7E7zgj0hmHWyfZTfGZTNlx/fbXGHxaa/wY= X-Sasl-enc: 72smTS8MPkaXwZCJSybwrQT7oxKIE90BK5y52acUSjJU 1439507688 Date: Thu, 13 Aug 2015 23:14:46 +0000 From: Daniel Shahaf To: Mikael Magnusson Cc: Oliver Kiddle , zsh workers Subject: Re: PATCH: highlight pasted text Message-ID: <20150813231446.GB1998@tarsus.local2> References: <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mikael Magnusson wrote on Thu, Jul 23, 2015 at 07:00:40 +0200: > Is there any way to use any of this (the highlighting) if you wrap the > widget to manipulate the text first? Here's an attempt to summarize the solutions proposed later in the thread: paste-and-munge() { local unmunged munged zle .bracketed-paste unmunged munged=":::${unmunged}:::" LBUFFER+=$munged (( MARK = $#LBUFFER - $#munged )) zle kill-region zle yank zle -R zle read-command && zle -U - $KEYS } bindkey -s $zle_bracketed_paste[2] paste-and-munge zle -N bracketed-paste paste-and-munge zle_highlight=(paste:standout) I haven't incorporated split-undo.