File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -622,13 +622,14 @@ point) to check."
622
622
(put 'definline 'clojure-doc-string-elt 2 )
623
623
(put 'defprotocol 'clojure-doc-string-elt 2 )
624
624
625
-
626
625
(defun clojure-indent-line ()
627
626
" Indent current line as Clojure code."
628
627
(if (clojure-in-docstring-p)
629
628
(save-excursion
630
629
(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))))
632
633
(replace-match (clojure-docstring-fill-prefix))))
633
634
(lisp-indent-line )))
634
635
Original file line number Diff line number Diff line change @@ -107,6 +107,32 @@ values of customisable variables."
107
107
(->>
108
108
|expr)" )
109
109
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
+
110
136
(provide 'clojure-mode-indentation-test )
111
137
112
138
; ; Local Variables:
You can’t perform that action at this time.
0 commit comments