Skip to content

Commit 54a1042

Browse files
committed
Merge pull request #576 from Yuhta/fix-xref-marker-ring-buf
Fix buffer in the marker pushed by xref-push-marker-stack
2 parents afec6b9 + 1a641e6 commit 54a1042

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

haskell-commands.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,12 @@ position with `xref-pop-marker-stack'."
340340
(haskell-mode-handle-generic-loc loc)
341341
(call-interactively 'haskell-mode-tag-find))
342342
(unless (equal initial-loc (point-marker))
343-
(save-excursion
344-
(goto-char initial-loc)
345-
(set-mark-command nil)
346-
;; Store position for return with `xref-pop-marker-stack'
347-
(xref-push-marker-stack)))))
343+
(with-current-buffer (marker-buffer initial-loc)
344+
(save-excursion
345+
(goto-char initial-loc)
346+
(set-mark-command nil)
347+
;; Store position for return with `xref-pop-marker-stack'
348+
(xref-push-marker-stack))))))
348349

349350
;;;###autoload
350351
(defun haskell-mode-goto-loc ()

0 commit comments

Comments
 (0)