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] api: nvim_get_mode() #6247

Merged
merged 4 commits into from
Apr 28, 2017
Merged

[RFC] api: nvim_get_mode() #6247

merged 4 commits into from
Apr 28, 2017

Commits on Apr 28, 2017

  1. api: nvim_get_mode()

    Asynchronous API functions are served immediately, which means pending
    input could change the state of Nvim shortly after an async API function
    result is returned.
    
    nvim_get_mode() is different:
      - If RPCs are known to be blocked, it responds immediately (without
        flushing the input/event queue)
      - else it is handled just-in-time before waiting for input, after
        pending input was processed. This makes the result more reliable
        (but not perfect).
    
    Internally this is handled as a special case, but _semantically_ nothing
    has changed: API users never know when input flushes, so this internal
    special-case doesn't violate that. As far as API users are concerned,
    nvim_get_mode() is just another asynchronous API function.
    
    In all cases nvim_get_mode() never blocks for more than the time it
    takes to flush the input/event queue (~µs).
    
    Note: This doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if
    e.g. `d` is operator-pending.
    
    Closes neovim#6159
    justinmk committed Apr 28, 2017
    Configuration menu
    Copy the full SHA
    3ea1007 View commit details
    Browse the repository at this point in the history
  2. input.c: Process only safe events before blocking.

    Introduce multiqueue_process_priority() to process only events at or
    above a certain priority.
    justinmk committed Apr 28, 2017
    Configuration menu
    Copy the full SHA
    acfd2a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f17a818 View commit details
    Browse the repository at this point in the history
  4. event: Remove "priority" concept.

    It was replaced by the "child queue" concept (MultiQueue).
    justinmk committed Apr 28, 2017
    Configuration menu
    Copy the full SHA
    8f59d14 View commit details
    Browse the repository at this point in the history