Thanks, the culprit is the call to treesit-update-ranges in treesit--pre-redisplay, where we don’t pass it any specific range, so it updates the range for the whole buffer. Eli, is there any way to get a rough estimate the range that redisplay is refreshing? Do you think something like this would work? (treesit-update-ranges (max (point-min) (- (window-start) 1000)) ; BEG (min (point-max) (+ (or (window-end) (+ (window-start) 4000)) 1000))) ; END I guess the window-start would be outdated in pre-redisplay-function... Yuan