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

Feature request: ability to select objects in overlays #255

Closed
yyoncho opened this issue Oct 28, 2018 · 5 comments
Closed

Feature request: ability to select objects in overlays #255

yyoncho opened this issue Oct 28, 2018 · 5 comments

Comments

@yyoncho
Copy link
Contributor

yyoncho commented Oct 28, 2018

One of the drawbacks of displaying actions in overlays similar to what lsp-ui is doing is that you cannot "trigger" to them using keyboard. It would be good if avy supports overlay as a target location. See noctuid/link-hint.el#24 for more detailed discussion.

@noctuid

@abo-abo
Copy link
Owner

abo-abo commented Jan 17, 2019

It's not clear for me what you're trying to do. Please elaborate.

I saw your example with "link in overlay" button. But navigating there might not be a well posed problem, since the overlay doesn't occupy a point, it's not possible to move the point there, only to some other point close to it.

At that point, you can just detect where your overlays are and use plain-old avy--process for the real point positions before the overlay.

@yyoncho
Copy link
Contributor Author

yyoncho commented Jan 17, 2019

Sorry for the vague description. In lsp-mode and lsp-ui we use overlays to present Code Actions and Lenses - see screenshot.

I want to be able to make them accessible with the keyboard and link-hint(which uses avy display engine) seems to be a good fit for solving this problem.

I want to achieve the following: Pass a list of overlays + position in overlay and avy will allow selecting the item just like you can do that with avy-goto-word-1. Please let me know whether this makes sense from avy point of view. I haven't checked avy code yet.

emacs myoncho_084

@abo-abo
Copy link
Owner

abo-abo commented Jan 22, 2019

Pass a list of overlays + position in overlay and avy will allow selecting the item just like you can do that with avy-goto-word-1

This is doable, maybe in a slightly different way. Like I said, overlays don't occupy a point, so it doesn't make sense for me to splice an avy overlay in the middle of a different overlay.
But adding it at the beginning or the end of an overlay is fine. In fact, you simply pass the point position where the existing overlay is located.

Here's an example:

(avy--process '(10 20 30))
;; => 20

Just pass the point positions of the overlay, get the selected position back and locate the overlay by position.

@yyoncho
Copy link
Contributor Author

yyoncho commented Jan 22, 2019

@abo-abo
One overlay could have multiple actions in it, and at one point we could have multiple overlays. Check the following screenshot:

https://user-images.githubusercontent.com/13259670/51136922-4ff8e600-1846-11e9-9275-c668314082e5.png

@yyoncho
Copy link
Contributor Author

yyoncho commented Jan 22, 2019

I followed the avy--process handling and I believe that passing custom display-fn and cleanup-fn will possibly be able to handle our case. Thanks for the pointer

yyoncho added a commit to yyoncho/avy that referenced this issue Feb 17, 2019
Fixes abo-abo#255

- I have renamed it to avy-process to indicate that it is used from another
  packages.
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