-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RPC call (K_EVENT) completes pending op (d, y, ...) #6166
Comments
dd
yy
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
Until now, asynchronous API functions never flush the input queue. `nvim_get_mode()` is different: - if RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it flushes the input/event queue in order to determine whether pending input would cause RPCs to block, then responds with the result 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 function. In all cases `nvim_get_mode()` never blocks for more than the time it takes to flush the input/event queue (~µs). Note that this doesn't address neovim#6166; nvim_get_mode() will provoke neovim#6166 if e.g. `d` is operator-pending. Closes neovim#6159
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
Related problem: Shougo/deoplete.nvim#477 ale uses timer feature. |
Is this possibly also the reason why some plugin doesn't get invoked repeatedly? Ie. one plugin does
but this doesn't work any more; I can call the function registered for |
That's perfect, as long as it makes these operators fully blocking. I can just follow up with the <esc> equivalent if a user switches contexts.
… On Jul 9, 2017, at 12:33 PM, Justin M. Keyes ***@***.***> wrote:
@lunixbochs @Chillee @phmarek :set notimeout seems to workaround for this issue, in case that helps in the meantime.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@lunixbochs @Chillee @phmarek I spoke too soon, |
Searchable comment to maybe save someone 20 minutes of digging: YouCompleteMe seems to trigger this issue pretty reliably. |
This appears to also be triggered by a focus lost event, e.g. |
@tbodt Thanks for that bit of info about losing focus, made me realize why I kept hitting this bug. With neovim terminal running something like "top" in another window or tab, the current window will lose focus every time that buffer is updated, triggering this issue. Update: Also happens even if the terminal buffer is hidden, not in another window or tab. |
#7230 resolves this issue for operator-pending mode. Note also that RPCs are not blocked during operator-pending mode. We've decided that's it better to allow that and fix any resulting problems. If you notice any crashes during operator-pending mode, please report it.
|
Nice! What's the easiest way of getting the most up to date neovim version? |
The releases page: https://github.com/neovim/neovim/releases Or build from source. |
normal_finish_command() and normal_prepare() assume that any pending operator needs to be finished after any subsequent key. Set `finish_op = false` in nv_event() to indicate that the pending operator shouldn't be finished in normal_execute(). This is how nv_visual() indicates that 'v' or 'V' in operator-pending mode should not finish the current pending operator. fixes neovim#5398 fixes neovim#6166 (partially; mappings are still interrupted)
The "mapping" tests added in 541dde3 were flawed: - Unlike op-pending mode, RPCs are _blocked_ during map-pending. So a synchronous RPC like nvim_get_current_buf() waits until 'timeoutlen', then the mapping is canceled. - helpers.expect() also performs a blocking RPC, so again that must not intervene the two nvim_input() calls. closes neovim#6166
I'm still getting this double delete behaviour after installing NeoVIM 0.2.1 which was just released. $ nvim Am I not using the correct version? Is anyone else having these problems still? |
nvim --version
: v0.2.0-624-gddab466, v0.1.6Actual behaviour
input('d')
,nvim_buf_get_lines()
,input('d')
will either not delete a line, or will delete one line perinput('d')
depending on context. Yank viainput('y')
has the same behavior.Expected behaviour
input('d')
,nvim_buf_get_lines()
,input('d')
should act the same asinput('dd')
, or the API should expose some way of indicating a single input ofd
isn't finished so I shouldn't get the buffer yet.Steps to reproduce using
nvim -u NORC
Here's my output: https://gist.github.com/lunixbochs/582b2435c6c2ba7e8f12fd2ee7df2f7f
Note the last case with p=False that doesn't query
buf[:]
will exhibit the correct output.The text was updated successfully, but these errors were encountered: