Skip to content

Commit 83ce80c

Browse files
vspinubbatsov
authored andcommitted
Improve detection of doc-strings
1 parent 174b1e1 commit 83ce80c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clojure-mode.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,15 @@ This could cause problems.
566566

567567
(defsubst clojure-in-docstring-p ()
568568
"Check whether point is in a docstring."
569-
(eq (get-text-property (point) 'face) 'font-lock-doc-face))
569+
(let ((ppss (syntax-ppss)))
570+
;; are we in a string?
571+
(when (nth 3 ppss)
572+
;; check font lock at the start of the string
573+
(eq (get-text-property (nth 8 ppss) 'face)
574+
'font-lock-doc-face))))
570575

571576
(defsubst clojure-docstring-fill-prefix ()
572577
"The prefix string used by `clojure-fill-paragraph'.
573-
574578
It is simply `clojure-docstring-fill-prefix-width' number of spaces."
575579
(make-string clojure-docstring-fill-prefix-width ? ))
576580

0 commit comments

Comments
 (0)