Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lazy-helm/spacemacs/helm-jump-in-buffer work with evil-jump-backward #15741

Open
fleimgruber opened this issue Sep 18, 2022 · 10 comments
Open

Comments

@fleimgruber
Copy link
Contributor

As in subject, doing an evil-jump-backward with C-o after a lazy-helm/spacemacs/helm-jump-in-buffer with SPC s j does not jump back to the position curser was on before helm-jumping, but to any other buffer position evil-jump remembers (usually very old and unrelated or from a few movements in the past). Are users supposed to use a different command combination for this functionality?

@lebensterben
Copy link
Collaborator

(defun spacemacs/helm-jump-in-buffer ()

only does jumping but doesn't try to remember the last position before jumping...

@fleimgruber
Copy link
Contributor Author

Thanks for the quick reply! I see, so what is the recommendation for "evilifying" *-jump and other commands to make them work more nicely with C-o & C-i? The latter two are etched into my nervous system. Or is there a more Spacemacs-ish way of going back to last cursor position?

@lebensterben
Copy link
Collaborator

this command needs to remember the position... that's it

@fleimgruber
Copy link
Contributor Author

Oh, I misread your comment then. It sounded to me as if you were saying that spacemacs/helm-jump-in-buffer does what it should, i.e. that it is supposed to not remember the last position, but to jump only. And that remembering the position should be solved on user side, e.g. with the advice system (or similar).

@pataquets
Copy link
Contributor

Related: #9451

@xuan-w
Copy link
Contributor

xuan-w commented May 3, 2023

Oh, I misread your comment then. It sounded to me as if you were saying that spacemacs/helm-jump-in-buffer does what it should, i.e. that it is supposed to not remember the last position, but to jump only. And that remembering the position should be solved on user side, e.g. with the advice system (or similar).

I got confused by this conversation too.

Here is how I solve this:

(evil-add-command-properties #'spacemacs/helm-jump-in-buffer :jump t)

Since evil has provided a simple mechanism to do this, no need to write an advice. Not sure if evil-define-motion will be better.

@lebensterben
Copy link
Collaborator

this is really a neat solution.

@fleimgruber
Copy link
Contributor Author

fleimgruber commented May 4, 2023

Here is how I solve this:

(evil-add-command-properties #'spacemacs/helm-jump-in-buffer :jump t)

This looks really nice, but does not work for me. Previous helm-jump-in-buffer locations are not visited by evil-jump-backward.

edit: My bad, it works with (evil-add-command-properties #'lazy-helm/spacemacs/helm-jump-in-buffer :jump t)

@fleimgruber
Copy link
Contributor Author

@lebensterben although this is labelled "Feature request", would the "Found work-around" label make sense?

@fleimgruber
Copy link
Contributor Author

fleimgruber commented May 1, 2024

Please note that the actual jump function you are using might have changed in the meantime, e.g.:

(evil-add-command-properties #'spacemacs/consult-jump-in-buffer :jump t)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants