Closed cpitclaudel closed 7 years ago
That's interesting. I'd never seen Emacs font-lock the buffer that lazily. Aggressive-indent has changed a bit since you posted this issue. If it's still a problem I can look into it.
It's still an issue :)
I sometimes have mismatched parentheses, and these tend to cause reindentation of large bits of the file. Often these bits aren't syntax-highlighted.
I'll try adding a variable you can configure to font-lock the buffer, is that ok?
You should be able to fix your problem by doing:
(add-function :before
aggressive-indent-region-function
#'font-lock-ensure)
Hi there,
I commonly run into cases in which aggressive-indent does its thing in an invisible part of the buffer, before that part has been fontified. The issue with that is that I use nameless, and thus fontification is relevant to indentation.
The solution could be as simple as running font-lock-ensure on the appropriate region before indenting, but if that's too costly in general there could be a function set to #'ignore by default that nameless would hook into.
Cheers, and thanks for the cool packages!