zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-workers@zsh.org
Subject: Re: region_highlight cancels styles set in zle_highlight
Date: Mon, 7 Sep 2015 21:21:20 +0000	[thread overview]
Message-ID: <20150907212120.GA9512@tarsus.local2> (raw)
In-Reply-To: <20150907094856.2634355a@pwslap01u.europe.root.pri>

Peter Stephenson wrote on Mon, Sep 07, 2015 at 09:48:56 +0100:
> On Mon, 7 Sep 2015 02:08:14 +0000
> Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > Peter Stephenson wrote on Sun, Sep 06, 2015 at 18:22:30 +0100:
> > > On Sat, 5 Sep 2015 10:44:49 +0000
> > > Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > > > How do $zle_highlight and $region_highlight interact?  Which one takes
> > > > precedence if a certain byte range is covered by both?
> > > 
> > > The special forms of highlight (the ones that apply to regions, so not,
> > > for example, unprintable characters) are treated as the initial set of
> > > entries in the array of highlights to apply, with any user-specified
> > > ones in region_highlight following in order, with later values
> > > overriding earlier ones.
> > 
> > Thanks.  Patch to doc this:
> 
> Thanks, that's useful.

Committed with a small tweak to also list 'suffix' in the list of
zle_highlight contexts that apply prior to region_highlight.

> By the way, the code for this is fairly localised in
> Src/Zle/zle_refresh.c, with the decisions made in the chunk of code at
> the top of character loop in singlerefresh() after the comment
> "Calculate attributes based on region": the special and user-defined
> attributes have been coalesced into the array region_highlights at this
> point.  So if there's a good argument for alternative or variant
> behaviour it shouldn't be too difficult, by ZLE standards.

Thanks for the pointer, it was useful.

Cheers,

Daniel


  reply	other threads:[~2015-09-07 21:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 10:44 Daniel Shahaf
2015-09-06 17:22 ` Peter Stephenson
2015-09-07  2:08   ` Daniel Shahaf
2015-09-07  8:48     ` Peter Stephenson
2015-09-07 21:21       ` Daniel Shahaf [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-01 15:57 Mikael Magnusson
2011-06-01 15:59 ` Mikael Magnusson

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=20150907212120.GA9512@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=p.stephenson@samsung.com \
    --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).