Skip to content

Commit b788a8d

Browse files
committed
Add other-buffer flag to cider-jump-to
1 parent dd1c044 commit b788a8d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cider-interaction.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,15 @@ not found."
649649
(file (cadr (assoc "file" info))))
650650
(cider-find-file file)))
651651

652-
(defun cider-jump-to (buffer &optional pos)
652+
(defun cider-jump-to (buffer &optional pos other-buffer)
653653
"Push current point onto marker ring, and jump to BUFFER to position POS.
654654
POS can be either a cons cell (LINE . COLUMN) or a number representing the
655-
character position in a buffer. "
655+
character position in a buffer. If OTHER-BUFFER is non-nil use
656+
`pop-to-buffer' to jump to the location, otherwise `switch-to-buffer'."
656657
(ring-insert find-tag-marker-ring (point-marker))
658+
(if other-buffer
659+
(pop-to-buffer buffer)
660+
(switch-to-buffer buffer))
657661
(with-current-buffer buffer
658662
(widen)
659663
;; check if we have a (line . column) pair or just a buffer position
@@ -664,8 +668,7 @@ character position in a buffer. "
664668
(if (cdr pos)
665669
(move-to-column (cdr pos))
666670
(back-to-indentation)))
667-
(cider-mode +1))
668-
(switch-to-buffer buffer))
671+
(cider-mode +1)))
669672

670673
(defun cider-jump-to-resource (path &optional line)
671674
"Jump to the resource at the relative PATH, optionally at a specific LINE.

0 commit comments

Comments
 (0)