summaryrefslogtreecommitdiff
path: root/cider-find.el
diff options
context:
space:
mode:
authorTobias Gerdin <tgerdin@gmail.com>2018-07-02 21:35:19 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-07-31 19:34:13 +0300
commit728beadae8dc25a7ad82defa3e119b1528a25f65 (patch)
tree2ed90fc48bfffa69a54f69357ea82d4f2208c850 /cider-find.el
parented5f7ad93bcef343c801a9f02a080b7004e0e950 (diff)
Add command for finding variable using mouse
Diffstat (limited to 'cider-find.el')
-rw-r--r--cider-find.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/cider-find.el b/cider-find.el
index 7b598c5a..f74030bd 100644
--- a/cider-find.el
+++ b/cider-find.el
@@ -67,6 +67,17 @@ thing at point."
#'cider--find-var-other-window
#'cider--find-var))))
+;;;###autoload
+(defun cider-find-var-at-mouse (event)
+ "Find the definition of variable using mouse EVENT."
+ (interactive "e")
+ (cider-ensure-op-supported "info")
+ (if-let* ((symbol-file (save-excursion
+ (mouse-set-point event)
+ (cider-symbol-at-point 'look-back))))
+ (cider-find-dwim symbol-file)
+ (user-error "No variable or resource here")))
+
(defun cider--find-dwim (symbol-file callback &optional other-window)
"Find the SYMBOL-FILE at point.
CALLBACK upon failure to invoke prompt if not prompted previously.