Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: highlight pasted text
- X-seq: zsh-workers 35868
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: PATCH: highlight pasted text
- Date: Thu, 23 Jul 2015 07:00:40 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- 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==
- In-reply-to: <19088.1437274234@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <mo6325$r5k$1@ger.gmane.org> <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <modfdp$crn$1@ger.gmane.org> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu>
On Sun, Jul 19, 2015 at 4:50 AM, Oliver Kiddle <okiddle@xxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author