Skip to content

Commit 9749c08

Browse files
committed
[Fix #515] Prompt passed through 'jump to' functions.
1 parent d822737 commit 9749c08

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

cider-interaction.el

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,16 +1193,21 @@ See command `cider-mode'."
11931193
"Perform up using NS."
11941194
(mapconcat 'identity (butlast (split-string ns "\\.")) "."))
11951195

1196-
(defun cider-ido-var-select (ido-callback cider-ido-ns selected targets)
1197-
"Peform ido select using SELECTED and TARGETS."
1196+
(defun cider-ido-var-select (prompt ido-callback cider-ido-ns selected targets)
1197+
"Peform ido select using SELECTED and TARGETS.
1198+
If SELECTED is \"..\" then another selection is made for vars in the parent namespace of
1199+
CIDER-IDO-NS using PROMPT.
1200+
If SELECTED is a namespace then another selection is made against that namespace
1201+
using PROMPT.
1202+
Once a selecton is made IDO-CALLBACK is called with SELECTED."
11981203
;; TODO: immediate RET gives "" as selected for some reason
11991204
;; this is an OK workaround though
12001205
(cond ((equal "" selected)
1201-
(cider-ido-var-select ido-callback cider-ido-ns (car targets) targets))
1206+
(cider-ido-var-select prompt ido-callback cider-ido-ns (car targets) targets))
12021207
((equal "/" (substring selected -1)) ; selected a namespace
1203-
(cider-ido-read-var (substring selected 0 -1) ido-callback))
1208+
(cider-ido-read-var prompt (substring selected 0 -1) ido-callback))
12041209
((equal ".." selected)
1205-
(cider-ido-read-var (cider-ido-up-ns cider-ido-ns) ido-callback))
1210+
(cider-ido-read-var prompt (cider-ido-up-ns cider-ido-ns) ido-callback))
12061211
;; non ido variable selection techniques don't return qualified symbols, so this shouldn't either
12071212
(t (funcall ido-callback selected))))
12081213

@@ -1222,11 +1227,11 @@ See command `cider-mode'."
12221227
(cider-tooling-eval form (cider-ido-read-sym-handler label callback (current-buffer))
12231228
nrepl-buffer-ns))
12241229

1225-
(defun cider-ido-read-var (ns ido-callback)
1230+
(defun cider-ido-read-var (prompt ns ido-callback)
12261231
"Perform ido read var in NS using IDO-CALLBACK."
1227-
(cider-ido-read-sym-form "Var: " (prin1-to-string (cider-ido-form ns))
1232+
(cider-ido-read-sym-form prompt (prin1-to-string (cider-ido-form ns))
12281233
(lambda (selected targets)
1229-
(cider-ido-var-select ido-callback ns selected targets))))
1234+
(cider-ido-var-select prompt ido-callback ns selected targets))))
12301235

12311236
(defun cider-ido-fns-form (ns)
12321237
"Construct a Clojure form for reading fns using supplied NS."
@@ -1259,7 +1264,7 @@ if there is no symbol at point, or if QUERY is non-nil."
12591264
(let ((symbol-name (cider-symbol-at-point)))
12601265
(cond ((not (or current-prefix-arg query (not symbol-name)))
12611266
(funcall callback symbol-name))
1262-
(ido-mode (cider-ido-read-var nrepl-buffer-ns callback))
1267+
(ido-mode (cider-ido-read-var prompt nrepl-buffer-ns callback))
12631268
(t (funcall callback (read-from-minibuffer prompt symbol-name))))))
12641269

12651270
(defun cider-doc-buffer-for (symbol)

0 commit comments

Comments
 (0)