zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: highlight pasted text
Date: Thu, 23 Jul 2015 07:00:40 +0200	[thread overview]
Message-ID: <CAHYJk3TALs+zN4TpQAGEK-mYDJwxAyWnZc+E00HaW=rOKJJZbg@mail.gmail.com> (raw)
In-Reply-To: <19088.1437274234@thecus.kiddle.eu>

On Sun, Jul 19, 2015 at 4:50 AM, Oliver Kiddle <okiddle@yahoo.co.uk> 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


  parent reply	other threads:[~2015-07-23  5:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 16:51 bracketed paste Yuri D'Elia
2015-07-15 17:33 ` Yuri D'Elia
2015-07-15 18:15   ` Mikael Magnusson
2015-07-15 18:43     ` Yuri D'Elia
2015-07-16  5:19 ` Oliver Kiddle
2015-07-16 14:32   ` Yuri D'Elia
2015-07-18  2:33     ` Oliver Kiddle
2015-07-18 11:55       ` Yuri D'Elia
2015-07-18 17:17       ` Bart Schaefer
2015-07-18 23:28         ` Oliver Kiddle
2015-07-19  8:13           ` Unmetafy of getsparam() Bart Schaefer
2015-07-21 20:07             ` Peter Stephenson
2015-07-21 23:08               ` Bart Schaefer
2015-07-23  8:50             ` Peter Stephenson
2015-07-16 20:15   ` bracketed paste Bart Schaefer
2015-07-18 12:05     ` Yuri D'Elia
2015-07-18 18:08       ` Bart Schaefer
2015-07-19  2:50         ` PATCH: highlight pasted text Oliver Kiddle
2015-07-19  8:17           ` Bart Schaefer
2015-07-19 12:13           ` Yuri D'Elia
2015-07-19 17:12             ` Daniel Shahaf
2015-07-19 18:10               ` Bart Schaefer
2015-07-21 15:23                 ` Oliver Kiddle
2015-07-21 17:35                   ` Bart Schaefer
2015-07-23  3:57                     ` Oliver Kiddle
2015-07-19 17:57             ` Oliver Kiddle
2015-07-19 18:09               ` Yuri D'Elia
2015-08-08 21:51               ` Daniel Shahaf
2015-08-14  1:38                 ` Oliver Kiddle
2015-08-14  5:28                   ` Bart Schaefer
2015-07-23  5:00           ` Mikael Magnusson [this message]
2015-07-23  6:23             ` Oliver Kiddle
2015-07-24  5:06               ` Bart Schaefer
2015-07-24  5:21                 ` Bart Schaefer
2015-07-24 22:22                   ` Oliver Kiddle
2015-07-24 23:13                     ` Bart Schaefer
2015-07-25  7:49                       ` Oliver Kiddle
2015-07-25 16:46                         ` zle options (was Re: PATCH: highlight pasted text) Bart Schaefer
2015-07-28  9:09                           ` Oliver Kiddle
2015-07-24 19:06                 ` Vim special marks - Re: PATCH: highlight pasted text Oliver Kiddle
2015-07-24 19:45                   ` Bart Schaefer
2015-08-11 11:16                   ` Oliver Kiddle
2015-08-13 23:14             ` Daniel Shahaf
2015-08-13 23:50               ` Bart Schaefer
2015-08-14  2:09                 ` Oliver Kiddle
2015-08-14  5:24                   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3TALs+zN4TpQAGEK-mYDJwxAyWnZc+E00HaW=rOKJJZbg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).