[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66732: tree-sitter fontification doesn't update multi-line syntax re
From: |
Stefan Monnier |
Subject: |
bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably |
Date: |
Sat, 16 Dec 2023 12:11:07 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> Hmm... This `put-text-property` can't be right.
> Can you trace `font-lock-fontify-region` and
> `font-lock-default-fontify-region` to check that they correctly return
> the proper (extended) bounds of the region they (re)fontified?
BTW, using the extend-region-function isn't ideal: this is meant for
things which can't be refontified separately, so if a change in the
buffer causes notification to make changes over a large portion of the
buffer we'll end up (re)fontified *right away* that whole large
portion even if only a small part (or even no part at all) is displayed.
IOW, it'd be better to mark the changed chunks with this
`put-text-property`, but to do it before jit&font-lock get triggered.
Basically, we'd like to call it from `after-change-functions`, but this
can be called *many* times within a single command, so we want to delay
it. So we can probably just set a flag that says "there are unprocessed
changes" and then sprinkle calls to a "lazy update" function which
checks this flag before calling `treesit--font-lock-notifier` (or
something similar).
One of the places where we'd need the sprinkle would be
`pre-redisplay-functions`. Another one might be `syntax-ppss`?
Stefan
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, (continued)
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/13
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/14
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/14
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/15
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Stefan Monnier, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably,
Stefan Monnier <=
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Stefan Monnier, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Stefan Monnier, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/16
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/17
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/18
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Dmitry Gutov, 2023/12/19
- bug#66732: tree-sitter fontification doesn't update multi-line syntax reliably, Yuan Fu, 2023/12/20