Closed yyoncho closed 5 years ago
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.
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.
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.
@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
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
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 ifavy
supports overlay as a target location. See https://github.com/noctuid/link-hint.el/issues/24 for more detailed discussion.@noctuid