Skip to content

Commit 738f393

Browse files
katomusobbatsov
authored andcommitted
Change the way cider-docstring--format performs formatting
1 parent 3ab2709 commit 738f393

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

cider-docstring.el

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,10 @@ Prioritize rendering as much as possible while staying within `cider-docstring-m
149149

150150
(defun cider-docstring--format (string)
151151
"Return a nicely formatted STRING to be displayed to the user."
152-
(let* ((string (replace-regexp-in-string "\\. " ".\n\n" string)) ;; improve the formatting of e.g. clojure.core/reduce
153-
(string (mapconcat (lambda (line)
154-
;; Remove spaces at the beginning of each line, as it is common in many clojure.core defns:
155-
(replace-regexp-in-string "\\`[ ]+" "" line))
156-
(split-string string "\n")
157-
"\n")))
158-
string))
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.
155+
(replace-regexp-in-string "\n " "\n" string))
159156

160157
(provide 'cider-docstring)
161158
;;; cider-docstring.el ends here

0 commit comments

Comments
 (0)