* bug#75164: treesit-font-lock-fontify-region is easy to lost color on parse error. suggest to remain fontify on parse error.
@ 2024-12-28 16:25 Eval Exec
0 siblings, 0 replies; only message in thread
From: Eval Exec @ 2024-12-28 16:25 UTC (permalink / raw)
To: 75164
Hello.
When I enable rust-ts-mode on a rust file, I found treesitter is easy
to make emacs buffer to lost color.
For example, on the following rust code:
```rust
struct Dog {
name: String,
age: u8,
}
struct ManyStruct {
a: u8,
}
fn many_code(){
fn fib(n: u32) -> u32 {
if n == 0 {
return 0;
}
if n == 1 {
return 1;
}
fib(n - 1) + fib(n - 2)
}
}
fn main() {
// change below `//` to `/` to see the difference
// {
}
```
the rust code is right, and the emacs buffer color is right on every
struct/functions.
But, if I change `// {` to `/ {`, then the rust code is wrong, this
buffer will lost all colors.
You can see the change on bellow images:
https://imgur.com/a/4Tnv0GJ
I suggest emacs can remain colors even if the code is wrong.
My emacs version info: GNU Emacs 31.0.50
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-28 16:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 16:25 bug#75164: treesit-font-lock-fontify-region is easy to lost color on parse error. suggest to remain fontify on parse error Eval Exec
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).