aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-18 12:46:04 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-18 21:28:20 -0300
commit4d63d9917482a7d7a002bf7688233a675b76cd3e (patch)
treefc861fa278e095a38d4b39bb9ac736321446b6da /src/nvim/os/input.c
parent8b7b71f4742d94cf7a2e5a08e7b2f5a725619476 (diff)
downloadrneovim-4d63d9917482a7d7a002bf7688233a675b76cd3e.tar.gz
rneovim-4d63d9917482a7d7a002bf7688233a675b76cd3e.tar.bz2
rneovim-4d63d9917482a7d7a002bf7688233a675b76cd3e.zip
main: Simplify code that deals with early user input
A read stream will be started before the first ex command is processed. This stream will be used to read early user input before handling control over to the UI module. Which stdio stream will be used depends on which types of file descriptors are connected, and whether the "-" argument was passed.
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r--src/nvim/os/input.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 00efa28161..a409a9ed13 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -46,7 +46,7 @@ void input_init(void)
input_buffer = rbuffer_new(INPUT_BUFFER_SIZE + MAX_KEY_CODE_LEN);
}
-void input_start_stdin(void)
+void input_start_stdin(int fd)
{
if (read_stream) {
return;
@@ -54,7 +54,7 @@ void input_start_stdin(void)
read_buffer = rbuffer_new(READ_BUFFER_SIZE);
read_stream = rstream_new(read_cb, read_buffer, NULL);
- rstream_set_file(read_stream, fileno(stdin));
+ rstream_set_file(read_stream, fd);
rstream_start(read_stream);
}
@@ -69,7 +69,7 @@ void input_stop_stdin(void)
read_stream = NULL;
}
-// Low level input function.
+// Low level input function
int os_inchar(uint8_t *buf, int maxlen, int ms, int tb_change_cnt)
{
if (rbuffer_pending(input_buffer)) {