emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
689 stars 55 forks source link

Feature Req: Start helm session with previous input #49

Open hura opened 9 years ago

hura commented 9 years ago

I think I'd be nice to start a helm swoop session with the previous input. Can this be easily achieved with the pre-input-function?

ShingoFukuyama commented 9 years ago

M-x helm-resume could solve the issue? It's not helm-swoop specific, though.

Otherwise, try this :)

;; If there is no symbol at the cursor, use the last used words instead.
(setq helm-swoop-pre-input-function
      (lambda ()
        (let (($pre-input (thing-at-point 'symbol)))
          (if (eq (length $pre-input) 0)
              helm-swoop-pattern ;; this variable keeps the last used words
            $pre-input))))
hura commented 9 years ago

Thanks that's exactly what I needed. Feel free to accept or reject the PR that I just submitted if you think it's too trivial to be added to the README. Cheers

hura commented 9 years ago

So I have one last question: When I'm already in a helm swoop session, how can I pull the current Symbol under cursor into the search prompt (ie clearing the existing one). If this could be bound to some function we would have all the flexibility:

IMO, that would be nice.