File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -622,13 +622,14 @@ point) to check."
622622(put 'definline 'clojure-doc-string-elt 2 )
623623(put 'defprotocol 'clojure-doc-string-elt 2 )
624624
625-
626625(defun clojure-indent-line ()
627626 " Indent current line as Clojure code."
628627 (if (clojure-in-docstring-p)
629628 (save-excursion
630629 (beginning-of-line )
631- (when (looking-at " ^\\ s-*" )
630+ (when (and (looking-at " ^\\ s-*" )
631+ (<= (string-width (match-string-no-properties 0 ))
632+ (string-width (clojure-docstring-fill-prefix))))
632633 (replace-match (clojure-docstring-fill-prefix))))
633634 (lisp-indent-line )))
634635
Original file line number Diff line number Diff line change @@ -107,6 +107,32 @@ values of customisable variables."
107107(->>
108108 |expr)" )
109109
110+ (check-indentation doc-strings-without-indent-specified
111+ "
112+ (defn some-fn
113+ |\" some doc string\" "
114+ "
115+ (defn some-fn
116+ |\" some doc string\" " )
117+
118+ (check-indentation doc-strings-with-correct-indent-specified
119+ "
120+ (defn some-fn
121+ |\" some doc string\" "
122+ "
123+ (defn some-fn
124+ |\" some doc string\" " )
125+
126+ (check-indentation doc-strings-with-additional-indent-specified
127+ "
128+ (defn some-fn
129+ |\" some doc string
130+ - some note\" "
131+ "
132+ (defn some-fn
133+ |\" some doc string
134+ - some note\" " )
135+
110136(provide 'clojure-mode-indentation-test )
111137
112138; ; Local Variables:
You can’t perform that action at this time.
0 commit comments