File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -148,10 +148,14 @@ Prioritize rendering as much as possible while staying within `cider-docstring-m
148
148
(concat string (when (> (length lines) max-lines) " ..." ))))
149
149
150
150
(defun cider-docstring--format (string )
151
- " Return a nicely formatted STRING to be displayed to the user."
152
- ; ; As this is a literal docstring from the source code and
153
- ; ; there are two spaces at the beginning of lines in docstrings,
154
- ; ; we remove them to make it align nicely when it is displayed.
151
+ " Return a nicely formatted STRING to be displayed to the user.
152
+
153
+ We need to format the docstring before displaying it to the user
154
+ because it is obtained from the source code. For example, this means
155
+ that it usually has two spaces before each line used for indentation
156
+ \( see https://guide.clojure.style/#docstring-indentation). While displaying
157
+ the docstring to the user, we usually want to control indentation and
158
+ other aspects of the presentation, so we format it before displaying."
155
159
(replace-regexp-in-string " \n " " \n " string))
156
160
157
161
(provide 'cider-docstring )
You can’t perform that action at this time.
0 commit comments