Allow show-paren to show matching parentheses inside comments

* lisp/paren.el (show-paren--default): Improve blinking when
inside a comment (bug#5410).
This commit is contained in:
Lars Ingebrigtsen 2022-05-02 11:02:01 +02:00
parent f70dfb74cc
commit 95507dd403

View file

@ -225,6 +225,13 @@ It is the default value of `show-paren-data-function'."
(let* ((temp (show-paren--locate-near-paren))
(dir (car temp))
(outside (cdr temp))
;; If we're inside a comment, then we probably want to blink
;; a matching parentheses in the comment. So don't ignore
;; comments in that case.
(parse-sexp-ignore-comments
(if (ppss-comment-depth (syntax-ppss))
nil
parse-sexp-ignore-comments))
pos mismatch here-beg here-end)
;;
;; Find the other end of the sexp.