-
Notifications
You must be signed in to change notification settings - Fork 32
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
Enhancement: expose ID of window created by vim.ui.input
#58
Comments
The original reason why I'm a little more hesitant to return the window ID from the call because this starts to change the default built-in API. There is some precedent for this, as I decided to add an API extension in e607dd9, but I want to be extra cautious about these sorts of things and preferably do it in a way that is guaranteed to never conflict with the built-in API. |
Thanks a lot, this should resolve my main issue. I'm fine with leaving it like this if you don't want to change the API since there exists a workaround to get the ID. Still, I'm curious what exactly the API contract is here / why is returning something instead of |
Two reasons:
These are small potential issues and I could be convinced otherwise, but in general I think that maintaining exact API compatibility is valuable and should not be broken lightly. |
Note that I had to revert this change to |
Thanks for letting me know! No, as it stands now this won't affect me :) |
Hi,
I'm currently trying to add proper support for
dressing.nvim
in my plugin inc-rename.nvim (the current implementation has issues, see smjonas/inc-rename.nvim#17). Basically, I need to control the window created bydressing.nvim
from the command line and change the input text while the user is typing. For this to work, I need to get the ID of the window created byvim.ui.input
.At the moment, I am doing the following to find the ID:
This almost works but using
vim.schedule
is problematic as that doesn't work well with Nvim's command preview callback. Omittingvim.schedule
won't work because you useschedule_wrap
ininput.lua
here (so I need to schedule my code to run after yours):dressing.nvim/lua/dressing/input.lua
Line 276 in 96b09a0
Therefore, I am proposing the following enhancements:
no_schedule
/synchronous
/sync
passed to theopts
key invim.ui.input
which won't schedule wrap the function if set totrue
(let me know which name you'd prefer)no_schedule
/synchronous
/sync
is set, return the window ID fromvim.ui.input
Please let me know if you have any another ideas / suggestions! I can send a PR if you want :)
The text was updated successfully, but these errors were encountered: