[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: C++-mode: Syntax highlighting: wrong color for funct

From: martin rudalics
Subject: Re: address@hidden: C++-mode: Syntax highlighting: wrong color for function identifier depending on the kind of whitespace that follows]
Date: Wed, 15 Feb 2006 11:17:16 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> Note, tho, that the 1000-byte search would probably only only happen when
> the line has a ">>" on it.

... has or _had_ a ">>" on it.

> And it's all very much fast enough for
> self-insert-command.

It may show up when using auto-repeat for typing characters.

> The problem is much more severe when you're running
> a command that does many buffer modification and thus runs the hook
> many times without intervening user interaction.

In particular the hook might trigger fontification for regions that are
not displayed thus defeating the purpose of jit-lock.  When you indent,
fill, delete larger regions you have to search all beginnings and ends
of those regions within the 1000 char limit for "<<"s and ">>"s that
might have changed.

I still believe that an idle timer would be more appropriate here.  Have
the hook accumulate the bounds of the most recent changes to a buffer.
A timed function would scan from some suitable position before the
displayed area - this can be some 1000 chars before window-start but I'd
prefer something more Archimedean here like the start of a syntactic
entity that cannot appear within "<<" ... ">>" - and search for matching
"<<" ">>" pairs between that position and the maximum of the last
changed position within the displayed area and the next syntactic entity
that can't be within "<<" ... ">>".  Obviously, this should be done for
every window showing that buffer.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]