Skip to content

Make compatible with evil-jumper #268

Closed

Description

@sooheon

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?

Activity

  1. abo-abo commented on Oct 19, 2015

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

  2. abo-abo commented on Nov 13, 2015

    @abo-abo
    Owner

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

  3. sooheon commented on Nov 13, 2015

    @sooheon
    ContributorAuthor

    Confirmed work with evil-mode as well. Thanks.

  4. srustamo commented on Aug 25, 2016

    @srustamo

    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?

  5. srustamo commented on Aug 25, 2016

    @srustamo

    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)))
  6. srustamo commented on Aug 25, 2016

    @srustamo

    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.

  7. abo-abo commented on Aug 25, 2016

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions