[Top][All Lists]

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

contextual refontification (was: [PATCH] Re: Algorithm in electric-pair-

From: Stefan Monnier
Subject: contextual refontification (was: [PATCH] Re: Algorithm in electric-pair--unbalanced-strings-p unsuitable for CC Mode)
Date: Tue, 09 Jul 2019 11:40:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> * Fontifying "broken" strings only until EOL might be beneficial, at least
> in certain languages, where it's consistent with the syntax. The result will
> be less "blinking".

This problem is not specific to strings: it also affects comments.

BTW, the current default behavior delays re-fontifying the rest of the
buffer (so called "contextual refontification") by jit-lock-context-time
(by default 0.5s) which can sometimes avoid the flashing.

It was not implemented specifically for that purpose, but it does
sometimes have that effect.  Maybe we could develop a hack for font-lock
which would do it in a less "accidental" way.

IOW make it so that font-lock:
- delays refontification after the current line if the end of line is
  now within a string/comment (and wasn't before).
- "un-delays" this fontification if the end of line is now outside of any
  string/comment (but was within it before).
- of course, with some kind of timeout, but one longer than 0.5s.

Or something like that.


reply via email to

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