Closed mariari closed 3 weeks ago
What function do you use to jump back? What function do you have bound to Meta point?
jump back or M-,
is xref-go-back.
Meta Point, is the default jump to definition, which in this case isminijuvix-goto-definition
. Though it seems other languages use a variety of techniques.
In the CL mode I have I see.
(xref-push-marker-stack)
in it.
(defun lispy-goto-symbol (symbol)
"Go to definition of SYMBOL.
SYMBOL is a string."
(interactive (list (or (thing-at-point 'symbol t)
(lispy--current-function))))
(lispy--remember)
(deactivate-mark)
(xref-push-marker-stack)
...)
In Haskell and OCaml I see the following being called
(defun xref-find-definitions (identifier)
"Find the definition of the identifier at point.
With prefix argument or when there's no identifier at point,
prompt for it.
If sufficient information is available to determine a unique
definition for IDENTIFIER, display it in the selected window.
Otherwise, display the list of the possible definitions in a
buffer where the user can select from the list.
Use \\[xref-go-back] to return back to where you invoked this command."
(interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier nil))
Probably (xref-push-marker-stack)
might be the simplest to implement
Fixed by #18
It seems if I jump to a definition with Meta point, then you can't jump back, it gives me the message
at the start of xref history
. I think this may be an issue with theminijuvix-mode
itself (currently I'm not having this issue with this in other modes).