From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29651 invoked by alias); 23 Jul 2015 05:00:44 -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: 35868 Received: (qmail 8591 invoked from network); 23 Jul 2015 05:00:42 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=K47BatgpE9oyNYCtou+1vWTYue2VK6Pu+pj+3p9hOYE=; b=zDjAX0dLjXzX0B9jYmNaljBHv+nLC102MZbYadsPnI0lhEod4kHymNKU04Wd0Fpw3f PgJXDU2Oh9DJTfRV6ExEFEDnT4b/A2QheMrtJYaMarhzQKIi1+HnB9KHDnKPE1EQFuq2 4Gfwak+SsIjd4GLtVU7yYeBwFgCzmGmULprcIBCwg7as8vjWfawLMUEX4ZNRMcAkzScC ysyKb+YVfBN+E1OPmGVOTo5uVHYFRN2TCfo99A3HYan92hD6V9w9moAOZCOc0TmLoBZv VXXW4b3vXYtVJWrtJAy4CGGReePCld8W2fi5gtJUdiUgtKBJ/0rVwkt6+rvm/Fn7pQOs HqCA== MIME-Version: 1.0 X-Received: by 10.50.143.101 with SMTP id sd5mr12007722igb.44.1437627640599; Wed, 22 Jul 2015 22:00:40 -0700 (PDT) In-Reply-To: <19088.1437274234@thecus.kiddle.eu> References: <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> Date: Thu, 23 Jul 2015 07:00:40 +0200 Message-ID: Subject: Re: PATCH: highlight pasted text From: Mikael Magnusson To: Oliver Kiddle Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Sun, Jul 19, 2015 at 4:50 AM, Oliver Kiddle wrote: > Bart wrote: >> There are a couple of features that might be useful if we could come up >> with a way to do them. One would be an indication of whether bracketed >> paste is supported at all, so that no one is taken by surprise when the > > That's not possible as far as I know. If it was possible to detect that, > we'd be able to make the sending of the start/end strings conditional. > >> shell starts executing what they pasted. Another is some indication of >> what text was pasted (maybe highlight-color it differently?). > > How about the following patch? This adds another special token to > zle_highlight. So you can do, e.g: zle_highlight+=( paste:bg=87 ) > This applies also for vi put and emacs yank commands. > > We were already tracking start/end positions of a paste for the purposes > of the yank-pop widget. Using those, leads to some further changes: > > Text from a bracketed paste is now added to the cutbuffer. As far as > I can tell, this seems to actually also be what the GUI mode of emacs > does. Though emacs is perhaps not putting duplicates in. It'd be good if > some actual emacs users could check that it all makes sense, however. > > I had been pondering how to interface bracketed-paste with vi registers, > anyway. This will now also put the bracketed paste in the numbered > registers. If you explicitly name a vi register, the pasted text is now > NOT inserted: it is only assigned to the register. This seems quite > useful if not the most vim compatible. For a middle-mouse click after > naming a register, gvim will paste the named register at the position > under the mouse. Is there any way to use any of this (the highlighting) if you wrap the widget to manipulate the text first? -- Mikael Magnusson