summaryrefslogtreecommitdiff
path: root/cider-doc.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2016-04-07 22:47:10 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2016-04-08 11:54:23 -0300
commit02a1cffb1a80306d66a2be10259d87dc71a7079a (patch)
treed4073272d98866c8439e0f84b0fef247cecfcbef /cider-doc.el
parent6710bc2b921bd960d38f9f6d6637202d1e5f641c (diff)
Doc buffer splits arglists into several lines
Instead of this: org.httpkit.client/post ([url & [opts callback]] [url & [callback]]) Issues an async HTTP POST request. See `request` for details. We get this: org.httpkit.client/post [url & [opts callback]] [url & [callback]] Issues an async HTTP POST request. See `request` for details.
Diffstat (limited to 'cider-doc.el')
-rw-r--r--cider-doc.el12
1 files changed, 11 insertions, 1 deletions
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