diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-27 16:08:44 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-27 16:08:44 -0300 |
commit | dca8853f0031ab7ac960037d3b848107355d7056 (patch) | |
tree | 90cecee10a75f8035fd0df02629d999853318450 /src/nvim/os/input.c | |
parent | f6c89ec70409badb7ca477de47dd1f8dbf3de376 (diff) | |
parent | bf6bb27e79f53646309ba075655465919bc2e60c (diff) | |
download | rneovim-dca8853f0031ab7ac960037d3b848107355d7056.tar.gz rneovim-dca8853f0031ab7ac960037d3b848107355d7056.tar.bz2 rneovim-dca8853f0031ab7ac960037d3b848107355d7056.zip |
Merge PR #1565 'Cleanup ui module'
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r-- | src/nvim/os/input.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index d10d20b20e..686fe1f06d 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -17,8 +17,11 @@ #include "nvim/keymap.h" #include "nvim/mbyte.h" #include "nvim/fileio.h" +#include "nvim/ex_cmds2.h" #include "nvim/getchar.h" #include "nvim/term.h" +#include "nvim/main.h" +#include "nvim/misc1.h" #define READ_BUFFER_SIZE 0xfff #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) @@ -184,7 +187,16 @@ size_t input_enqueue(String keys) static bool input_poll(int ms) { + if (do_profiling == PROF_YES && ms) { + prof_inchar_enter(); + } + event_poll_until(ms, input_ready()); + + if (do_profiling == PROF_YES && ms) { + prof_inchar_exit(); + } + return input_ready(); } @@ -282,7 +294,7 @@ static void convert_input(void) static void process_interrupts(void) { - if (!ctrl_c_interrupts) { + if (mapped_ctrl_c) { return; } @@ -326,3 +338,11 @@ static bool input_ready(void) (!embedded_mode && eof); // Stdin closed } +// Exit because of an input read error. +static void read_error_exit(void) +{ + if (silent_mode) /* Normal way to exit for "ex -s" */ + getout(0); + STRCPY(IObuff, _("Vim: Error reading input, exiting...\n")); + preserve_exit(); +} |