BUF_MODIFF was needed for fold/unfold correctness (org-mode), but ensureTextCache was called from postAccessibilityNotificationsForFrame: on every cursor move, causing O(buffer-size) rebuild on every font-lock pass. Fix: remove [self ensureTextCache] from the granularity-detection branch of the notification path. The granularity detection now uses cachedText directly, falling back to granularity_unknown when absent (safe: VoiceOver makes its own determination). ensureTextCache is called exclusively from AX getters (human interaction speed). Font-lock passes no longer trigger any cache rebuild. The BUF_MODIFF validity in ensureTextCache is retained (correct for fold/unfold). Comment updated to accurately describe the calling pattern. All 9 patches apply cleanly on fresh base (git apply verified).
37 KiB
37 KiB