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 compatible with evil-jumper #268

Closed
sooheon opened this issue Oct 17, 2015 · 7 comments
Closed

Make compatible with evil-jumper #268

sooheon opened this issue Oct 17, 2015 · 7 comments

Comments

@sooheon
Copy link
Contributor

@sooheon sooheon commented Oct 17, 2015

If using helm-swoop, after finding and moving point to a result, I can easily go back to my point before helm-swoop was called with evil-jumper/backward. With swiper, the previous point is not saved onto the evil-jumper "stack", and I have to go back by mark. Would it be possible to add this support?

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Oct 19, 2015

I'm not familiar with evil-jumper.

Here's the only part of helm-swoop to include "evil".

;; Receive word from evil search ---------------
(defun helm-swoop-from-evil-search ()
  "Invoke `helm-swoop' from evil isearch"
  (interactive)
  (if (string-match "\\(isearch-\\|evil.*search\\)" (symbol-name real-last-command))
      (helm-swoop :$query (if isearch-regexp
                              isearch-string
                            (regexp-quote isearch-string)))
    (helm-swoop)))
;; When doing evil-search, hand the word over to helm-swoop
;; (define-key evil-motion-state-map (kbd "M-i") 'helm-swoop-from-evil-search)

Can you explain what exactly you want me to do? Even better, a patch would be welcome.

@abo-abo abo-abo closed this in 6e9ab3d Nov 13, 2015
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Nov 13, 2015

Please test. It seems to work, at least with evil-mode off.

@sooheon
Copy link
Contributor Author

@sooheon sooheon commented Nov 13, 2015

Confirmed work with evil-mode as well. Thanks.

@srustamo
Copy link

@srustamo srustamo commented Aug 25, 2016

evil-jumper is OBSOLETE. evil-jumper has been merged into upstream evil-mode; therefore this functionality is already available by default..

So, the jump list does not get updated.

Perhaps testing for the evil-mode instead of evil-jumper-mode would help?

@srustamo
Copy link

@srustamo srustamo commented Aug 25, 2016

On a closer look, evil-mode requires evil-jumps package, which defines

(defun evil-set-jump (&optional pos)
  "Set jump point at POS.
POS defaults to point."
  (unless (or (region-active-p) (evil-visual-state-p))
    (push-mark pos t))

  (unless evil--jumps-jumping
    ;; clear out intermediary jumps when a new one is set
    (let* ((struct (evil--jumps-get-current))
           (target-list (evil--jumps-get-jumps struct))
           (idx (evil-jumps-struct-idx struct)))
      (cl-loop repeat idx
               do (ring-remove target-list))
      (setf (evil-jumps-struct-idx struct) -1))
    (evil--jumps-push)))
@srustamo
Copy link

@srustamo srustamo commented Aug 25, 2016

I'm not sure what is your stance on people commenting closed tickets, but I think keeping related stuff threaded helps other people find related stuff quicker.

Let me know if you prefer separate tickets instead.

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Aug 25, 2016

@srustamo Please open a new issue. I don't like reading messages from ages ago just to get a context of how it applies to the new message.

Regarding the change in evil-jumper, please consider submitting a PR.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.