diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-06-01 09:53:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-01 09:53:45 +0200 |
commit | 2008fe7b85a8c03cbff3ed51c5715ddf5cb555fd (patch) | |
tree | 3fe96507019c1d493f2e7f5212c35f063195b29d /src/nvim/os/input.c | |
parent | 50f6d364c661b88a1edc5ffc8e284d1c0ff70810 (diff) | |
parent | c13c50b752dca322a5ec77dea6188c9e3694549b (diff) | |
download | rneovim-2008fe7b85a8c03cbff3ed51c5715ddf5cb555fd.tar.gz rneovim-2008fe7b85a8c03cbff3ed51c5715ddf5cb555fd.tar.bz2 rneovim-2008fe7b85a8c03cbff3ed51c5715ddf5cb555fd.zip |
Merge pull request #29106 from bfredl/rwstream
refactor(io): separate types for read and write streams
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r-- | src/nvim/os/input.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 60b5b48745..cfe8696cdd 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -41,7 +41,7 @@ typedef enum { kInputEof, } InbufPollResult; -static Stream read_stream = { .closed = true }; // Input before UI starts. +static RStream read_stream = { .s.closed = true }; // Input before UI starts. static RBuffer *input_buffer = NULL; static bool input_eof = false; static bool blocking = false; @@ -59,7 +59,7 @@ void input_init(void) void input_start(void) { - if (!read_stream.closed) { + if (!read_stream.s.closed) { return; } @@ -70,12 +70,12 @@ void input_start(void) void input_stop(void) { - if (read_stream.closed) { + if (read_stream.s.closed) { return; } rstream_stop(&read_stream); - stream_close(&read_stream, NULL, NULL); + rstream_may_close(&read_stream); } #ifdef EXITFREE @@ -138,7 +138,7 @@ int os_inchar(uint8_t *buf, int maxlen, int ms, int tb_change_cnt, MultiQueue *e uint64_t wait_start = os_hrtime(); cursorhold_time = MIN(cursorhold_time, (int)p_ut); if ((result = inbuf_poll((int)p_ut - cursorhold_time, events)) == kInputNone) { - if (read_stream.closed && silent_mode) { + if (read_stream.s.closed && silent_mode) { // Drained eventloop & initial input; exit silent/batch-mode (-es/-Es). read_error_exit(); } @@ -489,7 +489,7 @@ bool input_available(void) return rbuffer_size(input_buffer) != 0; } -static void input_read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, bool at_eof) +static void input_read_cb(RStream *stream, RBuffer *buf, size_t c, void *data, bool at_eof) { if (at_eof) { input_eof = true; |