Subject: bug#59481: 29.0.50; c-ts-mode doesn't play nicely with pixel-scroll-precision-mode

From: Yuan Fu <[email-masked]>
Date: Tue, 22 Nov 2022 12:44:18 -0800

Po Lu <[email-masked]> writes:

> Enable pixel-scroll-precision-mode, then open src/xterm.c.  Go to line
> 3439, enable c-ts-mode, and scroll up _with a trackpad_ until line 1675
> becomes visible near the start of the window.  Finally, go down to line
> 1817: brackets will become randomly fontified in the error face.
>
> In addition, I was expecting c-ts-mode to be quite a lot faster
> fontifying during precision scrolling, but it is currently as slow as CC
> Mode.  I think that is almost definitely a bug somewhere in our
> tree-sitter fontification code, since emacs-lisp-mode fontifies much
> faster.

How do you decide if the scrolling is fast or not? Maybe you are seeing
palpable lags? I’m using macOS with the builtin trackpad, and scrolling
is pretty snappy. Maybe this only happens on Linux? I’m also seeing
random error faces (albeit not on brackets), could this relate to some
particular way pixel-scrolling works? Does pixel-scrolling do anything
special comparing to normal scrolling when fontifying text?

Thanks,
Yuan