Pass POS to sp-point-in-string

And doom-point-in-string-or-comment-p is no longer side-effect-free, due
to sp-point-in-* caching syntax-ppss.
This commit is contained in:
Henrik Lissner 2020-01-03 05:14:53 -05:00
parent 5495922a20
commit 63d42c97bc
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -51,12 +51,11 @@ POS defaults to the current position."
;; REVIEW Should we cache `syntax-ppss'?
(let ((pos (or pos (point))))
(or (run-hook-with-args-until-success 'doom-point-in-string-functions pos)
(sp-point-in-string))))
(sp-point-in-string pos))))
;;;###autoload
(defun doom-point-in-string-or-comment-p (&optional pos)
"Return non-nil if POS is in a string or comment."
(declare (side-effect-free t))
(or (doom-point-in-string-p pos)
(doom-point-in-comment-p pos)))