diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-18 08:38:15 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-18 12:51:35 -0300 |
commit | 42112e04a999c0f289939fce3142ef2c2517110a (patch) | |
tree | 5f2a1dd7395461be1bc6df7aa259fa8dd63008d3 /src/nvim/getchar.c | |
parent | 68de5d79a243fecc9ef256d9d0356f8541aa3821 (diff) | |
download | rneovim-42112e04a999c0f289939fce3142ef2c2517110a.tar.gz rneovim-42112e04a999c0f289939fce3142ef2c2517110a.tar.bz2 rneovim-42112e04a999c0f289939fce3142ef2c2517110a.zip |
ui: Refactor input buffer handling
All input buffer code was moved to os/input.c, and `inbuf` is now a `RBuffer`
instance(which abstracts static buffer manipulation).
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index c3f6e2c2b6..fd60664b7b 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -50,6 +50,7 @@ #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/os/event.h" +#include "nvim/os/input.h" /* * These buffers are used for storing: @@ -1201,9 +1202,7 @@ void save_typeahead(tasave_T *tp) readbuf1.bh_first.b_next = NULL; tp->save_readbuf2 = readbuf2; readbuf2.bh_first.b_next = NULL; -# ifdef USE_INPUT_BUF - tp->save_inputbuf = get_input_buf(); -# endif + tp->save_inputbuf = input_buffer_save(); } /* @@ -1224,9 +1223,7 @@ void restore_typeahead(tasave_T *tp) readbuf1 = tp->save_readbuf1; free_buff(&readbuf2); readbuf2 = tp->save_readbuf2; -# ifdef USE_INPUT_BUF - set_input_buf(tp->save_inputbuf); -# endif + input_buffer_restore(tp->save_inputbuf); } /* @@ -2551,21 +2548,6 @@ fix_input_buffer ( return len; } -#if defined(USE_INPUT_BUF) || defined(PROTO) -/* - * Return TRUE when bytes are in the input buffer or in the typeahead buffer. - * Normally the input buffer would be sufficient, but feedkeys() may insert - * characters in the typeahead buffer while we are waiting for input to arrive. - */ -int input_available(void) -{ - return !vim_is_input_buf_empty() - || typebuf_was_filled - ; -} - -#endif - /* * map[!] : show all key mappings * map[!] {lhs} : show key mapping for {lhs} |