summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--cider-doc.el12
2 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc6d9c06..00624435 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,7 @@ an individual test using `C-c C-t t`.
### Changes
+* Doc buffer splits arglists into several lines.
* Changed the face of the words “Macro” and “Special form” in the doc buffer to be easier to see.
* Display multi-line eval overlays at the start of the following line. It looked weird that these overlays started on the middle of a line, but then folded onto the start of following lines.
* [#1627](https://github.com/clojure-emacs/cider/issues/1627): Align the terminology used by `cider-test` with the one used by lein and boot (use the terms `assertion` and `test`).
diff --git a/cider-doc.el b/cider-doc.el
index 2a517d1a..a5b21ef8 100644
--- a/cider-doc.el
+++ b/cider-doc.el
@@ -400,7 +400,17 @@ Tables are marked to be ignored by line wrap."
(when (or super ifaces)
(insert "\n"))
(when (or forms args)
- (emit (cider-font-lock-as-clojure (or forms args))))
+ (insert " ")
+ (save-excursion
+ (emit (cider-font-lock-as-clojure (substring (or forms args) 1 -1))))
+ ;; It normally doesn't happen, but it's technically conceivable for
+ ;; the args string to contain unbalanced sexps, so `ignore-errors'.
+ (ignore-errors
+ (forward-sexp 1)
+ (while (not (looking-at "$"))
+ (insert "\n")
+ (forward-sexp 1)))
+ (forward-line 1))
(when (or special macro)
(emit (if special "Special Form" "Macro") 'font-lock-variable-name-face))
(when added