From 24d59b1546d963c2b92f67a8efde951db90182da Mon Sep 17 00:00:00 2001 From: Greg Hendershott Date: Fri, 10 Nov 2023 10:08:40 -0500 Subject: [PATCH] Clamp font-lock-flush positions; fixes #674 --- racket-hash-lang.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/racket-hash-lang.el b/racket-hash-lang.el index 00cf7de7..837f621d 100644 --- a/racket-hash-lang.el +++ b/racket-hash-lang.el @@ -403,7 +403,10 @@ lang's attributes that we care about have changed." All we do here is mark the span as not fontified, then let jit-lock do its thing if/when this span ever becomes visible." ;;;(message "racket--hash-lang-on-changed-tokens %s %s %s" _gen beg end) - (font-lock-flush beg end)) + (save-restriction + (widen) + (font-lock-flush (max beg (point-min)) + (min end (point-max))))) ;;; Fontification