emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#64329: closed (29.0.92; treesit/fill-paragraph syntax highlighting p


From: GNU bug Tracking System
Subject: bug#64329: closed (29.0.92; treesit/fill-paragraph syntax highlighting problem)
Date: Thu, 29 Jun 2023 18:18:01 +0000

Your message dated Thu, 29 Jun 2023 11:17:26 -0700
with message-id <9B70253C-512B-463D-B04C-CC33D486FFE0@gmail.com>
and subject line Re: bug#64329: 29.0.92; treesit/fill-paragraph syntax 
highlighting problem
has caused the debbugs.gnu.org bug report #64329,
regarding 29.0.92; treesit/fill-paragraph syntax highlighting problem
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
64329: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64329
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.0.92; treesit/fill-paragraph syntax highlighting problem Date: Wed, 28 Jun 2023 12:46:04 -0400
I've noticed this problem on multiple tree-sitter major modes including
c-ts-mode, c++-ts-mode, java-ts-mode, bash-ts-mode.  I haven't tried
others, but I suspect those might also suffer from this problem.

The issue occurs when attempting to fill the paragraph of a comment
block.  The following comment block can be used as an example to
reproduce the problem and happens with "emacs -Q" (assuming
corresponding tree-sitter libraries are available).

--8<---------------cut here---------------start------------->8---
// The quick brown fox jumps over the
// lazy dog.
// The quick brown fox jumps over the lazy dog.
--8<---------------cut here---------------end--------------->8---

Switch to one of the tree-sitter modes (e.g., M-x java-ts-mode).  Move
point to the first line of the comment block above and then execute the
fill-paragraph command (i.e., M-q).

The text which is wrapped onto the first line of the comment block will
be highlighted incorrectly.  The results appear as if the comment
delimiter was removed, fontification occurred, then the text was moved
to the first line of the comment block and never refontified with the
comment face.



--- End Message ---
--- Begin Message --- Subject: Re: bug#64329: 29.0.92; treesit/fill-paragraph syntax highlighting problem Date: Thu, 29 Jun 2023 11:17:26 -0700

> On Jun 28, 2023, at 10:22 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 28 Jun 2023 17:17:14 -0700
>> Cc: 64329@debbugs.gnu.org,
>> Eli Zaretskii <eliz@gnu.org>
>> 
>> Prompted by this, I went over all the functions that calls 
>> signal_after_change again, and found two other editfns.c functions that are 
>> missing calls to treesit_record_change. Please see the attached patches that 
>> follows the previous one. Sorry for the overlook. I believe I’ve found all 
>> places that needs to call treesit_record_change now.
>> 
>>> Please see the attached patch. Eli, is it more preferable to add a 
>>> subroutine in insdel.c that does what "for (i = 0; i < len; i++) *p++ = 
>>> tostr[I];” does, plus calling treesit_record_change, and make 
>>> subst-char-in-region call that subroutine? (This way editfns.c don’t need 
>>> to include treesit.h and call treesit_record_change itself.)
>> 
>> Since now there are three functions in editfns.c that needs to call 
>> treesit_record_change, we might as well just include treesit.h and call 
>> treesit_record_change directly.
> 
> Right.

Ok, I've pushed the changes.

Yuan

--- End Message ---

reply via email to

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