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

having different scope for f and t #63

Open
liujoey opened this issue May 19, 2018 · 3 comments
Open

having different scope for f and t #63

liujoey opened this issue May 19, 2018 · 3 comments

Comments

@liujoey
Copy link

liujoey commented May 19, 2018

Hello,

Is there anyway to set scope to visible for s/S, while still using scope line for f/t/F/T? Thank you.

@hlissner
Copy link
Owner

Not natively, but I believe you could manage it with:

(defun restrict-to-line-scope (orig-fn &rest args)
  (let ((evil-snipe-scope 'line))
    (apply orig-fn args)))
(advice-add #'evil-snipe-f :around #'restrict-to-line-scope)
(advice-add #'evil-snipe-F :around #'restrict-to-line-scope)
(advice-add #'evil-snipe-t :around #'restrict-to-line-scope)
(advice-add #'evil-snipe-T :around #'restrict-to-line-scope)

I'm working on a rewrite of evil-snipe (it was written when I was still new to Elisp). I'll find a way to work this into it.

@liujoey
Copy link
Author

liujoey commented May 21, 2018

Thank you.

@Deewiant
Copy link

Note that such advice doesn't propagate through to ; and , even if you set evil-snipe-repeat-scope in it as well. If you want to have a different evil-snipe-repeat-scope for f/t/F/T as well, I think you have to write a different advice function for evil-snipe-repeat that looks at the internal evil-snipe--last variable to determine the scope properly when repeating.

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

No branches or pull requests

3 participants