@@ -676,25 +676,18 @@ not found."
676
676
(file (nrepl-dict-get info " file" )))
677
677
(cider-find-file file)))
678
678
679
- (defun cider-jump-to (buffer &optional pos other-buffer )
680
- " Push current point onto marker ring, and jump to BUFFER to position POS.
681
- POS can be either a cons cell (LINE . COLUMN) or a number representing the
682
- character position in a buffer. If OTHER-BUFFER is non-nil use
683
- `pop-to-buffer' to jump to the location, otherwise `switch-to-buffer' ."
679
+ (defun cider-jump-to (buffer &optional line other-buffer )
680
+ " Push current point onto marker ring, and jump to BUFFER and LINE.
681
+ If OTHER-BUFFER is non-nil use `pop-to-buffer' to jump to the location,
682
+ otherwise `switch-to-buffer' ."
684
683
(ring-insert find-tag-marker-ring (point-marker ))
685
684
(if other-buffer
686
685
(pop-to-buffer buffer)
687
686
(switch-to-buffer buffer))
688
687
(with-current-buffer buffer
689
688
(widen )
690
- ; ; check if we have a (line . column) pair or just a buffer position
691
- (if (not (consp pos))
692
- (goto-char pos)
693
- (goto-char (point-min ))
694
- (forward-line (1- (or (car pos) 1 )))
695
- (if (cdr pos)
696
- (move-to-column (cdr pos))
697
- (back-to-indentation )))
689
+ (forward-line (1- (or line 1 )))
690
+ (back-to-indentation )
698
691
(cider-mode +1 )))
699
692
700
693
(defun cider-jump-to-resource (path &optional line )
@@ -706,7 +699,7 @@ When called interactively, this operates on point."
706
699
(nrepl-send-sync-request)
707
700
(plist-get :value )))
708
701
(buffer (cider-find-file resource)))
709
- (cider-jump-to buffer ( cons line nil ) )
702
+ (cider-jump-to buffer line)
710
703
(message " Cannot find resource %s " path)))
711
704
712
705
(defun cider--jump-to-loc-from-info (info &optional other-buffer )
@@ -717,7 +710,7 @@ OTHER-BUFFER is passed to `cider-jamp-to'."
717
710
(file (nrepl-dict-get info " file" ))
718
711
(buffer (unless (cider--tooling-file-p file)
719
712
(cider-find-file file))))
720
- (cider-jump-to buffer ( cons line nil ) other-buffer)))
713
+ (cider-jump-to buffer line other-buffer)))
721
714
722
715
(defun cider-jump-to-var (&optional var line )
723
716
" Jump to the definition of VAR, optionally at a specific LINE.
0 commit comments