diff options
-rw-r--r-- | src/nvim/os/rstream.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c index 1025201f7a..c3e0dea098 100644 --- a/src/nvim/os/rstream.c +++ b/src/nvim/os/rstream.c @@ -24,7 +24,7 @@ struct rstream { uv_file fd; rstream_cb cb; size_t buffer_size, rpos, wpos, fpos; - bool reading, free_handle, async; + bool reading, free_handle, defer; }; #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -38,21 +38,19 @@ struct rstream { /// for reading with `rstream_read` /// @param buffer_size Size in bytes of the internal buffer. /// @param data Some state to associate with the `RStream` instance -/// @param async Flag that specifies if the callback should only be called -/// outside libuv event loop(When processing async events with -/// KE_EVENT). Only the RStream instance reading user input should set -/// this to false +/// @param defer Flag that specifies if callback invocation should be deferred +/// to vim main loop(as a KE_EVENT special key) /// @return The newly-allocated `RStream` instance RStream * rstream_new(rstream_cb cb, size_t buffer_size, void *data, - bool async) + bool defer) { RStream *rv = xmalloc(sizeof(RStream)); rv->buffer = xmalloc(buffer_size); rv->buffer_size = buffer_size; rv->data = data; - rv->async = async; + rv->defer = defer; rv->cb = cb; rv->rpos = rv->wpos = rv->fpos = 0; rv->stream = NULL; @@ -333,7 +331,7 @@ static void close_cb(uv_handle_t *handle) static void emit_read_event(RStream *rstream, bool eof) { - if (rstream->async) { + if (rstream->defer) { Event event; event.type = kEventRStreamData; |