|
72 | 72 | (let* ((bol (line-beginning-position))
|
73 | 73 | (eol (line-end-position))
|
74 | 74 | (line (buffer-substring-no-properties bol eol)))
|
75 |
| - (if (file-directory-p line) |
76 |
| - (dired line) |
77 |
| - (find-file-other-window line)))) |
| 75 | + (find-file-other-window line))) |
78 | 76 |
|
79 | 77 | (defun cider-classpath-handle-mouse (event)
|
80 | 78 | "Handle mouse click EVENT."
|
81 | 79 | (interactive "e")
|
82 | 80 | (cider-classpath-operate-on-point))
|
83 | 81 |
|
| 82 | +(defun cider--classpath-entries () |
| 83 | + "Return a list of classpath entries." |
| 84 | + (plist-get |
| 85 | + (nrepl-send-sync-request (list "op" "classpath" |
| 86 | + "session" (nrepl-current-session))) |
| 87 | + :value)) |
| 88 | + |
84 | 89 | ;;;###autoload
|
85 | 90 | (defun cider-classpath ()
|
86 | 91 | "List all classpath entries."
|
87 | 92 | (interactive)
|
88 | 93 | (with-current-buffer (cider-popup-buffer cider-classpath-buffer t)
|
89 |
| - (let ((names (plist-get |
90 |
| - (nrepl-send-sync-request (list "op" "classpath" |
91 |
| - "session" (nrepl-current-session))) |
92 |
| - :value))) |
93 |
| - (cider-classpath-list (current-buffer) |
94 |
| - (mapcar (lambda (name) |
95 |
| - (cider-classpath-properties name)) |
96 |
| - names))))) |
| 94 | + (cider-classpath-list (current-buffer) |
| 95 | + (mapcar (lambda (name) |
| 96 | + (cider-classpath-properties name)) |
| 97 | + (cider--classpath-entries))))) |
| 98 | + |
| 99 | +;;;###autoload |
| 100 | +(defun cider-open-classpath-entry () |
| 101 | + "Open a classpath entry." |
| 102 | + (interactive) |
| 103 | + (-when-let (entry (completing-read "Classpath entries: " (cider--classpath-entries))) |
| 104 | + (find-file-other-window entry))) |
97 | 105 |
|
98 | 106 | (defvar cider-classpath-mouse-map (make-sparse-keymap))
|
99 | 107 | (define-key cider-classpath-mouse-map [mouse-1] 'cider-classpath-handle-mouse)
|
|
0 commit comments