Skip to content

Commit 2e51d40

Browse files
Tianxiang Xiongbbatsov
authored andcommitted
Only handle mouse event on highlighted text
1 parent 72544bc commit 2e51d40

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cider-browse-spec.el

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ Display TITLE at the top and SPECS are indented underneath."
114114
(goto-char (point-max))
115115
(insert (cider-propertize title 'emph) "\n")
116116
(dolist (spec-name specs)
117-
(insert (format " %s\n"
118-
(if (char-equal (elt spec-name 0) ?:)
119-
(cider-browse-spec--propertize-keyword spec-name)
120-
(cider-browse-spec--propertize-fn spec-name)))))
117+
(let ((propertize-fn (if (char-equal (elt spec-name 0) ?:)
118+
#'cider-browse-spec--propertize-keyword
119+
#'cider-browse-spec--propertize-fn)))
120+
(thread-first (concat " " (funcall propertize-fn spec-name) "\n")
121+
(propertize 'spec-name spec-name)
122+
insert)))
121123
(goto-char (point-min)))))
122124

123125
(defun cider--qualified-keyword-p (str)
@@ -338,7 +340,8 @@ If FILTER-REGEX is empty, list all specs in the registry."
338340
(defun cider-browse-spec-handle-mouse (event)
339341
"Handle mouse click EVENT."
340342
(interactive "e")
341-
(cider-browse-spec--browse-at-point))
343+
(when (eq 'highlight (get-text-property (point) 'mouse-face))
344+
(cider-browse-spec--browse-at-point)))
342345

343346
(provide 'cider-browse-spec)
344347

0 commit comments

Comments
 (0)