-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RDY] API/UI: Allow UI to set PUM position and size, and pass the position to CompleteChanged #11943
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
Conversation
Not familiar with the tests. Advices on how to proceed please? |
@bfredl is there anything I can do to improve this PR? |
Thanks @bfredl, addressed the review comments. :) |
Got this in the CI build:
Edit: add |
Existing tests should be OK now. |
@bfredl is |
Sounds over-engineering. bare Float args (as opposed to nested ones inside Object) are rare, we should just allow msgpack int for all of them (just as for all |
Updated gen_api_dispatch.lua. |
Tests should be OK now. |
Right, lua (5.1/luajit) doesn't even have proper int/float distinction, so you will get a msgpack int for |
Ah, that's why the tests were failing. :D |
Add test for |
Updated, thanks @bfredl. |
src/nvim/ui.c
Outdated
if (!uis[i]->pum_pos) { | ||
continue; | ||
} | ||
w = uis[i]->pum_width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can assign pwidth
etc directly here and call return
. then found
var can be eliminated.
src/nvim/popupmnu.c
Outdated
tv_dict_add_nr(dict, S_LEN("row"), pum_row); | ||
tv_dict_add_nr(dict, S_LEN("col"), pum_col); | ||
double w, h, r, c; | ||
ui_pum_get_pos(&w, &h, &r, &c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I think ui_pum_get_pos
could return a bool
if any UI was found. Then this could be
if(!ui_pum_get_pos(&w, &h, &r, &c)) {
w = pum_width;
h = pum_height;
...
}
and pum_get_internal_pos
removed.
done 🎵 |
Done. Also updated a few other occurrences in the file. |
getting this: |
could you rebase please (master has a fix for my build system) ? I could but dont want to push on your branch. |
@teto rebase and force pushed. |
this looks good. Could you simplify history a bit ? |
Yeah, time to learn some new git tricks :p |
…to CompleteChanged
…pum_set_bounds and tv_dict_add_float tests
…s: return first extui bounds information instead of reducing
@yatli Github orders the commits by author date instead of commit date. When you rebase the author date remains unchanged but the commit date is updated. |
This PR addresses #11879.
Before:

After:

Front-end changes: post the position and size information of pum with:

Back-end plugins don't need changes. Correct pum geometry will be passed to CompleteChanged.