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

Instead of consult-after-jump-function use xref-after-jump-hook #59

Closed
hmelman opened this issue Dec 12, 2020 · 2 comments
Closed

Instead of consult-after-jump-function use xref-after-jump-hook #59

hmelman opened this issue Dec 12, 2020 · 2 comments

Comments

@hmelman
Copy link

hmelman commented Dec 12, 2020

I like the new consult-after-jump-function but think it should behave the same as xref. That uses a hook not a function and defaults to both recenter and pulsing which is nice. I've modified xref to use reposition-window instead of recenter and think it would be great if consult either just used xref-after-jump-hook or set the default value of a consult-after-jump-hook to be the value of xref-after-jump-hook so I only have to set it once.

@minad
Copy link
Owner

minad commented Dec 12, 2020

Thank you for the input! I think it is better not to introduce an unnecessary dependency here. You can overwrite the consult-after-jump-function with a lambda which runs the corresponding xref hook. Since the consult-after-jump-function is used for the preview, it is crucial that it only performs benign operations - we cannot guarantee this if we execute the xref hooks instead. The priority is on correctness and robustness over minor conveniences during configuration. The package is explicitly designed such that it will require configuration, e.g., for the keybindings. Furthermore I may introduce a boolean argument to the consult-after-jump-function at some point such that the function can distinguish between jumps during preview and the final jump after selection.

I looked before if there are ways on how to integrate xref with consult, but I have to do a bit more digging - if you have ideas, please let me know!

@minad minad closed this as completed Dec 12, 2020
@minad
Copy link
Owner

minad commented Dec 12, 2020

@hmelman I generalized consult-after-jump-function to consult-after-jump-hook - this is actually nice since it is more aligned with the xref hooks.

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

No branches or pull requests

2 participants