From bd798a3267a496c644b339c45189b09e2a952014 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 19 Mar 2017 16:55:37 +0300 Subject: getchar: Use fileio instead of fdopen Problem: as fileio is cached and reads blocks this is going to wait until either EOF or reading enough characters to fill rbuffer. This is not good when reading user input from stdin as script. --- src/nvim/getchar.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/getchar.h') diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h index bdf65909b6..04517866ec 100644 --- a/src/nvim/getchar.h +++ b/src/nvim/getchar.h @@ -1,6 +1,8 @@ #ifndef NVIM_GETCHAR_H #define NVIM_GETCHAR_H +#include "nvim/os/fileio.h" + /* Values for "noremap" argument of ins_typebuf(). Also used for * map->m_noremap and menu->noremap[]. */ #define REMAP_YES 0 /* allow remapping */ @@ -12,6 +14,12 @@ #define KEYLEN_PART_MAP -2 /* keylen value for incomplete mapping */ #define KEYLEN_REMOVED 9999 /* keylen value for removed sequence */ +/// Maximum number of streams to read script from +enum { NSCRIPT = 15 }; + +/// Streams to read script from +extern FileDescriptor *scriptin[NSCRIPT]; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "getchar.h.generated.h" #endif -- cgit From 78bc52ea5397c092d01cd08296fe1dc85d998329 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 3 Dec 2017 16:50:37 +0300 Subject: getchar: Move REMAP_… values into a enum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/getchar.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/nvim/getchar.h') diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h index 5c92067a23..38a2e75663 100644 --- a/src/nvim/getchar.h +++ b/src/nvim/getchar.h @@ -6,15 +6,15 @@ #include "nvim/buffer_defs.h" #include "nvim/ex_cmds_defs.h" -/// Values for "noremap" argument of ins_typebuf(). Also used for -/// map->m_noremap and menu->noremap[]. -/// @addtogroup REMAP_VALUES -/// @{ -#define REMAP_YES 0 ///< allow remapping -#define REMAP_NONE -1 ///< no remapping -#define REMAP_SCRIPT -2 ///< remap script-local mappings only -#define REMAP_SKIP -3 ///< no remapping for first char -/// @} +/// Values for "noremap" argument of ins_typebuf() +/// +/// Also used for map->m_noremap and menu->noremap[]. +enum { + REMAP_YES = 0, ///< Allow remapping. + REMAP_NONE = -1, ///< No remapping. + REMAP_SCRIPT = -2, ///< Remap script-local mappings only. + REMAP_SKIP = -3, ///< No remapping for first char. +} RemapValues; #define KEYLEN_PART_KEY -1 /* keylen value for incomplete key-code */ #define KEYLEN_PART_MAP -2 /* keylen value for incomplete mapping */ -- cgit