Skip to content

Commit

Permalink
Improve formatting of spec in cider-doc buffer
Browse files Browse the repository at this point in the history
Fix #2150

Font-lock and align spec in `cider-doc` buffer properly.
  • Loading branch information
xiongtx committed Jan 2, 2018
1 parent f1dc754 commit 58e58e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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

0 comments on commit 58e58e5

Please sign in to comment.