A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00175.html below:

Re: Initial fontification in sh-mode with tree-sittter

Thanks for working on this.

The deeper problem is, if there is some regex-based-font-lock face in region A (applied when Emacs fontified region A), eg, highlighted TODO keywords in a docstring, they will be overwritten by the string face, if we just apply string face to the whole string and trigger redisplay.

I still need to get familiar with the parts of the code involved. But can we avoid this (potentially) expensive re-fontification by keeping a list of text properties/fonts applied to a region? Because if the region was not changed, aside from adding/removing comments, then it would not need to be re-parsed.

 

What I ended up doing is to set jit-lock-context-unfontify-pos to the beginning of the string node (aka beginning of region A). Then in a timer jit-lock-context will refontify everything after that position. And I have some measure to break possible infinite recursion (fontify region -> set jit-lock-context-unfontify-pos -> cause refontification -> fontify region -> …).

I still need to look at your fix more carefully as a similar issue exists for sh-mode and heredoc strings.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4