From bf6bb27e79f53646309ba075655465919bc2e60c Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 27 Nov 2014 14:58:04 -0300 Subject: ui: Remove redundant ui.h includes Also move read_error_exit to os/input.c --- src/nvim/os/input.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/os') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index d413921a5f..686fe1f06d 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -20,6 +20,8 @@ #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) @@ -336,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(); +} -- cgit