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:
parent
5495922a20
commit
63d42c97bc
1 changed files with 1 additions and 2 deletions
|
@ -51,12 +51,11 @@ POS defaults to the current position."
|
||||||
;; REVIEW Should we cache `syntax-ppss'?
|
;; REVIEW Should we cache `syntax-ppss'?
|
||||||
(let ((pos (or pos (point))))
|
(let ((pos (or pos (point))))
|
||||||
(or (run-hook-with-args-until-success 'doom-point-in-string-functions pos)
|
(or (run-hook-with-args-until-success 'doom-point-in-string-functions pos)
|
||||||
(sp-point-in-string))))
|
(sp-point-in-string pos))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-point-in-string-or-comment-p (&optional pos)
|
(defun doom-point-in-string-or-comment-p (&optional pos)
|
||||||
"Return non-nil if POS is in a string or comment."
|
"Return non-nil if POS is in a string or comment."
|
||||||
(declare (side-effect-free t))
|
|
||||||
(or (doom-point-in-string-p pos)
|
(or (doom-point-in-string-p pos)
|
||||||
(doom-point-in-comment-p pos)))
|
(doom-point-in-comment-p pos)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue