branch: elpa/cider
commit ca90a7a0efca854bc146806b153b45cd98557448
Author: Tom Dalziel <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Make item-lines buttons in cider-ns-browser
Especially for evil's RET, and clicking with the mouse
---
CHANGELOG.md | 2 ++
cider-browse-ns.el | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b52725af37c..f763f95f2d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
### Changes
+- Use buttons for items in cider-ns-browser to allow clicking and evil's RET
to navigate.
+
### Bugs fixed
- [#3853](https://github.com/clojure-emacs/cider/issues/3853): Fix mangling of
printed representations.
diff --git a/cider-browse-ns.el b/cider-browse-ns.el
index ce35b5a62e1..9fd1cb7c89a 100644
--- a/cider-browse-ns.el
+++ b/cider-browse-ns.el
@@ -232,7 +232,7 @@ displayed."
(t "")))))
(defun cider-browse-ns--display-list (keys items max-length &optional label)
- "Render the items of KEYS as condained in the nrepl-dict ITEMS.
+ "Render the items of KEYS as contained in the nrepl-dict ITEMS.
Pad the row to be MAX-LENGTH+1. If LABEL is non-nil, add a header to the
list of items."
@@ -245,7 +245,9 @@ list of items."
(first-doc-line (cider-browse-ns--first-doc-line doc))
(item-line (cider-browse-ns--propertized-item key items)))
(insert " ")
- (insert item-line)
+ (insert-text-button item-line
+ 'action (lambda (_)
(cider-browse-ns-operate-at-point))
+ 'face (cider-browse-ns--text-face (nrepl-dict-get
items key)))
(when cider-browse-ns-current-ns
(insert (make-string (+ (- max-length (string-width item-line)) 1)
?ยท))
(insert " " (propertize first-doc-line 'font-lock-face
'font-lock-doc-face)))