Skip to content

API: nvim_input_flush #10826

@justinmk

Description

@justinmk

Proposal 1: API clients want a deterministic way to wait until "all input since now" has been processed.

  1. new API function e.g. nvim_input_flush() ?
  2. the function generates a new token and puts it in the input queue: API: nvim_input returns a "ticket" which can be used to confirm when the input is processed #30760
    • the token is a pseudokey like <id:xxx> where xxx is a monotonic integer
  3. nvim_input_flush() blocks until the token is seen by os_inchar

Proposal 2 (alternative/additionally?): API clients want to know when specific input has been processed.

  1. new API function nvim_input2({keys}, {callback}): API: nvim_input returns a "ticket" which can be used to confirm when the input is processed #30760
  2. same as (2) in Proposal 2.
  3. When os_inchar sees a token it
    • invokes registered callbacks
    • emits nvim_input_event({token})

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions