paren.el: Fix part of bug#81035

* lisp/paren.el (show-paren--default): Syntax-propertize before narrowing.
This commit is contained in:
Stefan Monnier 2026-06-05 12:43:43 -04:00
parent fd1b5cd890
commit e9d1367a32

View file

@ -272,9 +272,14 @@ It is the default value of `show-paren-data-function'."
(save-restriction (save-restriction
;; Determine the range within which to look for a match. ;; Determine the range within which to look for a match.
(when blink-matching-paren-distance (when blink-matching-paren-distance
(narrow-to-region (let ((beg (max (point-min)
(max (point-min) (- (point) blink-matching-paren-distance)) (- (point) blink-matching-paren-distance))))
(min (point-max) (+ (point) blink-matching-paren-distance)))) ;; `syntax-propertize' can't widen so make sure it won't
;; need to (bug#81035).
(syntax-propertize beg)
(narrow-to-region
beg
(min (point-max) (+ (point) blink-matching-paren-distance)))))
;; Scan across one sexp within that range. ;; Scan across one sexp within that range.
;; Errors or nil mean there is a mismatch. ;; Errors or nil mean there is a mismatch.
(condition-case () (condition-case ()