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

[RFC] Add support for the pum_getpos() API #11562

Merged
merged 2 commits into from Dec 16, 2019

Conversation

sethfowler
Copy link
Contributor

Per #11537, vim has added a pum_getpos() function that allows you to get the position of the popup menu. (This happened in vim/vim#4827.) This function is used by plugins like YouCompleteMe, so it's helpful to have support for it in Neovim as well. This PR is a straightforward port of vim's implementation to Neovim.

Although my impression is that new Neovim functions are generally added via Lua now, for this particular function it seems to me that using C makes sense. The function body is only two lines, since it's just a wrapper around an existing internal function that is already present in Neovim.

This is a first step towards supporting YouCompleteMe's fancier completion features in Neovim. Once this lands, I'd like to investigate adding a compatibility layer between Neovim's popup window API and vim's. I'll need some general advice on how to get started there; presumably that code should live in runtime/lua, but I'm not totally clear on how to expose Lua functions as builtin Neovim functions.

This is a straightforward port to neovim of the pum_getpos() API added
to vim in vim/vim#4827.
@marvim marvim added the RFC label Dec 15, 2019
@bfredl bfredl merged commit 251b20e into neovim:master Dec 16, 2019
@bfredl
Copy link
Member

bfredl commented Dec 16, 2019

Nice, thanks!

@sethfowler sethfowler deleted the sethfowler/pum_getpos branch December 19, 2019 02:18
qvacua pushed a commit to qvacua/neovim that referenced this pull request Dec 21, 2019
Add support for the pum_getpos() API
janlazo added a commit to janlazo/neovim that referenced this pull request Dec 29, 2019
Problem:    Cannot get size and position of the popup menu.
Solution:   Add pum_getpos(). (Ben Jackson, closes vim/vim#4827)
vim/vim@e9bd572

neovim#11562 backported the vim patch.
This patch only updates the runtime/doc/ files to match Vim.
@janlazo
Copy link
Contributor

janlazo commented Dec 29, 2019

Check https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim next time when porting vim patches like vim/vim@e9bd572 for this feature.

janlazo added a commit to janlazo/neovim that referenced this pull request Dec 29, 2019
Problem:    Cannot get size and position of the popup menu.
Solution:   Add pum_getpos(). (Ben Jackson, closes vim/vim#4827)
vim/vim@e9bd572

neovim#11562 backported the vim patch.
This patch only updates the runtime/doc/ files to match Vim.
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

Successfully merging this pull request may close these issues.

None yet

4 participants