From d225349dc67a21982308078207786d65518d2c6c Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 13 Feb 2015 12:05:54 -0300 Subject: input: Remove input_buffer_{save,restore} The input buffer is only used for data that really came from another process and is only visible to os/input.c. Remove the input_buffer_{save,restore} functions, they are not necessary(Also can result in problems if data comes while the typeahead is saved). --- src/nvim/os/input.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/nvim/os/input.c') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index d5e29900e9..66b59d425d 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -157,27 +157,6 @@ bool os_isatty(int fd) return uv_guess_handle(fd) == UV_TTY; } -/// Return the contents of the input buffer and make it empty. The returned -/// pointer must be passed to `input_buffer_restore()` later. -String input_buffer_save(void) -{ - size_t inbuf_size = rbuffer_pending(input_buffer); - String rv = { - .data = xmemdup(rbuffer_read_ptr(input_buffer), inbuf_size), - .size = inbuf_size - }; - rbuffer_consumed(input_buffer, inbuf_size); - return rv; -} - -/// Restore the contents of the input buffer and free `str` -void input_buffer_restore(String str) -{ - rbuffer_consumed(input_buffer, rbuffer_pending(input_buffer)); - rbuffer_write(input_buffer, str.data, str.size); - free(str.data); -} - size_t input_enqueue(String keys) { char *ptr = keys.data, *end = ptr + keys.size; -- cgit