-
Notifications
You must be signed in to change notification settings - Fork 46
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
docs/fix: Telescope integration #149
Conversation
cd8c5ed
to
9222c12
Compare
are you aware of https://github.com/nvim-telescope/telescope-hop.nvim? it doesn't actually depend on hop.nvim. Is there any advantage to using leap.nvim as the target selection backend? |
not reinventing the wheel for every such plugin, easy to implement custom actions, consistent appearance & behavior (if one already uses Leap), etc. |
Ah, in fact, I wasn't. I had tried searching for something like this but I suppose I didn't use the correct keywords. I've added a link to that plugin so it'll be easier to find for someone like me :P
I agree with György's assessment, also using this plugin as a backend means a central place for configuration of label keys, appearance, etc. Another area where I could see this plugin really shine is in the selection between multiple autocomplete alternatives. If we were to try to go the telescope-hop.nvim route with that, we would have to re-implement the code for generating, displaying, and processing input for selecting between the labels. Integration with this plugin for autocomplete may be a bit more intricate however, so I think this is a good place to at least get started on #151. |
Hi! I think I'll close this for now. I'm planning to get back on track with my refactor initiative at #156 -- sorry, academic/life obligations became a bit overwhelming for me for some time, but now I should be able to find time for this again. I'm thinking, once that refactor is done, we can perhaps have a separate plugin for integrations with other plugins (esp. those with custom UIs like neogit, Mason, nvim-tree, etc.), where we can put the code from this config and others, and the user can opt-in to various integrations. (Though, the effort to integrate with other plugins could be quite involved -- we got pretty lucky here with the fact that the Telescope API was already sufficient for our needs, but of course that won't be the case for every plugin, so it will probably be necessary to make a number of upstreams PRs to enable this integration.) |
Hi, thank you so much for the effort and careful design you have put into this plugin. I have made good use of the API that you have provided to integrate this plugin with nvim-telescope/telescope.nvim. This allows you to use Leap to select an entry (I mapped this to
S
) or both select and perform the default action on an entry (I mapped this tos
):This required a small fix, as there were some calls to
vim.api.nvim_buf_del_extmark
,vim.api.nvim_buf/win_set_option
that could trigger after the telescope window/buffer were deleted (and thus result in an error), so I protected these by checkingvim.api.nvim_buf/win_is_valid
before calling them.I have added the config to the README, though I think it may be possible to turn this into its own telescope extension so you don't have to copy any code into your config (though it seems that those are generally use to define pickers rather than libraries of keymaps; I will look into it).