diff options
| author | Björn Linse <bjorn.linse@gmail.com> | 2016-05-12 13:18:04 +0200 |
|---|---|---|
| committer | Björn Linse <bjorn.linse@gmail.com> | 2016-08-20 10:25:33 +0200 |
| commit | 215922120c43163f4e1cc00851bd1b86890d3a28 (patch) | |
| tree | 60e3d96d8e31ea8d72d197ee740a4af89e5735cf /src/nvim/tui | |
| parent | 1b825a9ada4d89059645bc7a458e1e8d931c6161 (diff) | |
| download | rneovim-215922120c43163f4e1cc00851bd1b86890d3a28.tar.gz rneovim-215922120c43163f4e1cc00851bd1b86890d3a28.tar.bz2 rneovim-215922120c43163f4e1cc00851bd1b86890d3a28.zip | |
stream: set data together with callback
Diffstat (limited to 'src/nvim/tui')
| -rw-r--r-- | src/nvim/tui/input.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index be256f3ebc..3ef4d34c9a 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -38,7 +38,7 @@ void term_input_init(TermInput *input, Loop *loop) int curflags = termkey_get_canonflags(input->tk); termkey_set_canonflags(input->tk, curflags | TERMKEY_CANON_DELBS); // setup input handle - rstream_init_fd(loop, &input->read_stream, input->in_fd, 0xfff, input); + rstream_init_fd(loop, &input->read_stream, input->in_fd, 0xfff); // initialize a timer handle for handling ESC with libtermkey time_watcher_init(loop, &input->timer_handle, input); } @@ -49,13 +49,13 @@ void term_input_destroy(TermInput *input) uv_mutex_destroy(&input->key_buffer_mutex); uv_cond_destroy(&input->key_buffer_cond); time_watcher_close(&input->timer_handle, NULL); - stream_close(&input->read_stream, NULL); + stream_close(&input->read_stream, NULL, NULL); termkey_destroy(input->tk); } void term_input_start(TermInput *input) { - rstream_start(&input->read_stream, read_cb); + rstream_start(&input->read_stream, read_cb, input); } void term_input_stop(TermInput *input) @@ -340,7 +340,7 @@ static void read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, // // ls *.md | xargs nvim input->in_fd = 2; - stream_close(&input->read_stream, NULL); + stream_close(&input->read_stream, NULL, NULL); queue_put(input->loop->fast_events, restart_reading, 1, input); } else { loop_schedule(&main_loop, event_create(1, input_done_event, 0)); @@ -391,6 +391,6 @@ static void read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, static void restart_reading(void **argv) { TermInput *input = argv[0]; - rstream_init_fd(input->loop, &input->read_stream, input->in_fd, 0xfff, input); - rstream_start(&input->read_stream, read_cb); + rstream_init_fd(input->loop, &input->read_stream, input->in_fd, 0xfff); + rstream_start(&input->read_stream, read_cb, input); } |