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

Comments

Projects
None yet
3 participants
@sooheon
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Oct 19, 2015

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Nov 13, 2015

Owner

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

Owner

abo-abo commented Nov 13, 2015

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

@sooheon

This comment has been minimized.

Show comment
Hide comment
@sooheon

sooheon Nov 13, 2015

Contributor

Confirmed work with evil-mode as well. Thanks.

Contributor

sooheon commented Nov 13, 2015

Confirmed work with evil-mode as well. Thanks.

@srustamo

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo 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 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

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo 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 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

This comment has been minimized.

Show comment
Hide comment
@srustamo

srustamo 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.

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

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Aug 25, 2016

Owner

@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.

Owner

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