spacemacs
spacemacs copied to clipboard
Make `lazy-helm/spacemacs/helm-jump-in-buffer` work with `evil-jump-backward`
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?
https://github.com/syl20bnr/spacemacs/blob/3ba43e29165fb17d39baab528d63a63e907fa81a/layers/%2Bcompletion/helm/funcs.el#L566
only does jumping but doesn't try to remember the last position before jumping...
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?
this command needs to remember the position... that's it
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).
Related: #9451
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.
this is really a neat solution.
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)
@lebensterben although this is labelled "Feature request", would the "Found work-around" label make sense?
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)