@@ -116,6 +116,7 @@ by clicking or navigating to them by other means."
116
116
(define-key map " c" #'cider-inspector-set-max-coll-size )
117
117
(define-key map " d" #'cider-inspector-def-current-val )
118
118
(define-key map " t" #'cider-inspector-tap-current-val )
119
+ (define-key map " 1" #'cider-inspector-tap-at-point )
119
120
(define-key map [tab] #'cider-inspector-next-inspectable-object )
120
121
(define-key map " \C -i" #'cider-inspector-next-inspectable-object )
121
122
(define-key map " n" #'cider-inspector-next-inspectable-object )
@@ -386,6 +387,24 @@ current-namespace."
386
387
(error " Could not tap the current Inspector value: %s " err))))
387
388
(user-error " No CIDER session found" )))
388
389
390
+ (defun cider-inspector-tap-at-point ()
391
+ " Sends the current Inspector current sub-value (per POINT) to `tap>' ."
392
+ (interactive )
393
+ ; ; NOTE: we don't set `cider-inspector--current-repl' , because we mean to tap the current value of an existing Inspector,
394
+ ; ; so whatever repl was used for it, should be used here.
395
+ (if cider-inspector--current-repl
396
+ (seq-let (property value) (cider-inspector-property-at-point)
397
+ (pcase property
398
+ (`cider-value-idx
399
+ (let* ((idx value)
400
+ (response (cider-sync-request:inspect-tap-indexed idx)))
401
+ (nrepl-dbind-response response (value err)
402
+ (if value
403
+ (message " Successfully tapped the Inspector item at point " )
404
+ (error " Could not tap the Inspector item at point: %s " err)))))
405
+ (_ (error " No object at point " ))))
406
+ (user-error " No CIDER session found" )))
407
+
389
408
; ; nREPL interactions
390
409
(defun cider-sync-request:inspect-pop (&optional v2 )
391
410
" Move one level up in the inspector stack,
@@ -520,6 +539,13 @@ instead of just its \"value\" entry."
520
539
" Sends current inspector value to tap>."
521
540
(cider-nrepl-send-sync-request '(" op" " inspect-tap-current-value" ) cider-inspector--current-repl))
522
541
542
+ (defun cider-sync-request:inspect-tap-indexed (idx )
543
+ " Sends current inspector sub-value to tap>, per IDX."
544
+ (cl-assert idx)
545
+ (cider-nrepl-send-sync-request `(" op" " inspect-tap-indexed"
546
+ " idx" , idx )
547
+ cider-inspector--current-repl))
548
+
523
549
(defun cider-sync-request:inspect-expr (expr ns page-size max-atom-length max-coll-size &optional v2 )
524
550
" Evaluate EXPR in context of NS and inspect its result.
525
551
Set the page size in paginated view to PAGE-SIZE, maximum length of atomic
@@ -746,11 +772,11 @@ that value.
746
772
3. If point is on a range-button fetch and insert the range."
747
773
(interactive )
748
774
(seq-let (property value) (cider-inspector-property-at-point)
749
- (cl-case property
750
- (cider-value-idx
775
+ (pcase property
776
+ (` cider-value-idx
751
777
(cider-inspector-push value))
752
778
; ; TODO: range and action handlers
753
- (t (error " No object at point " )))))
779
+ (_ (error " No object at point " )))))
754
780
755
781
(defun cider-inspector-operate-on-click (event )
756
782
" Move to EVENT's position and operate the part."
0 commit comments