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

vim.ui_attach with ext_cmdline and ext_messages should have an event for user input with getchar or getcharstr #20311

Open
Tracked by #6
folke opened this issue Sep 23, 2022 · 3 comments
Labels
enhancement feature request lua stdlib ui ui-extensibility UI extensibility, events, protocol
Milestone

Comments

@folke
Copy link
Member

folke commented Sep 23, 2022

Feature already in Vim?

No response

Feature description

Currently, input() is handled by cmdline_show and confirm() is handled by msg_show.confirm.

There are no events yet to know theres any input requested from the user with getchar or getcharstr.

As a work-around, I'm wrapping the respective vim.fn functions, but that only works for Lua calls.

Would be great to have this as part of the ext_cmdline or ext_messages API.

@folke folke added the enhancement feature request label Sep 23, 2022
@zeertzjq zeertzjq added ui lua stdlib labels Sep 23, 2022
@folke
Copy link
Member Author

folke commented Sep 28, 2022

Closing this, since this can be checked with nvim_get_mode().blocking

@folke folke closed this as completed Sep 28, 2022
@folke folke reopened this Sep 28, 2022
@folke
Copy link
Member Author

folke commented Sep 28, 2022

Re-opening. We still would need some sort of message that a blocking input call will start, so we can force some things to render before blocking.

@bfredl bfredl added this to the 0.9 milestone Sep 28, 2022
@clason clason added the ui-extensibility UI extensibility, events, protocol label Oct 3, 2022
@bfredl bfredl modified the milestones: 0.9, 0.10 Apr 7, 2023
@pawelurbanski
Copy link

Dear Team,
Is there any pull request or a place where implementation ideas or progress can be tracked?
I am developing a plugin that uses the callbacks to handle messages. Studing Noice.nvim sources gave me some hints about possible workaround for the confirm and confirm_sub messages.
What I am trying to understand is the following:

  1. Does Neovim block to get the response and blocks the next redraw cycle?
  2. Does vim.schedule or vim.schedule_wrap could help to capture the answer from the user?

Thank you for any hints about any of the above questions.

Pawel

@justinmk justinmk modified the milestones: 0.10, 0.11 Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request lua stdlib ui ui-extensibility UI extensibility, events, protocol
Projects
None yet
Development

No branches or pull requests

6 participants