Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formatting of spec in cider-doc buffer #2151

Merged
merged 1 commit into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Changes

* [#2151](https://github.com/clojure-emacs/cider/pull/2151) Improve formatting of spec in `cider-doc` buffer

## 0.16.0 (2017-12-28)

### New Features
Expand Down
11 changes: 10 additions & 1 deletion cider-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,16 @@ Tables are marked to be ignored by line wrap."
(insert "\n")
(when spec
(emit "Spec: " 'font-lock-function-name-face)
(mapc (lambda (s) (insert s "\n")) spec)
(dolist (part spec)
(let ((role (car part))
(desc (cadr part)))
(insert (format "%-4s: " role))
(thread-first desc
cider-sync-request:format-code
cider-font-lock-as-clojure
(split-string "\n")
insert-rectangle))
(insert "\n"))
(insert "\n"))
(if cider-docview-file
(progn
Expand Down