diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-03-09 09:52:07 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-02 21:06:37 +0100 |
commit | a70fde1b45859bbe557261493bfff40aa90d469a (patch) | |
tree | 50589bf680a676fe7e0ba7b3d8bd527971d1ca22 /src/nvim/terminal.c | |
parent | 5fba8159213e7821d16cdbea379cb49ac8a6ee74 (diff) | |
download | rneovim-a70fde1b45859bbe557261493bfff40aa90d469a.tar.gz rneovim-a70fde1b45859bbe557261493bfff40aa90d469a.tar.bz2 rneovim-a70fde1b45859bbe557261493bfff40aa90d469a.zip |
build: enable -Wshadow
Note about shada.c:
- shada_read_next_item_start was intentionally shadowing `unpacked` and
`i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly
depended on those variable names.
- Macros were changed to parameterize `unpacked` (but not `i`). Macros
like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other
approach is messy.
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index f715344689..51bf22b31c 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -529,6 +529,20 @@ void terminal_send(Terminal *term, char *data, size_t size) term->opts.write_cb(data, size, term->opts.data); } +void terminal_paste(long count, char_u **y_array, size_t y_size) +{ + for (int i = 0; i < count; i++) { // -V756 + // feed the lines to the terminal + for (size_t j = 0; j < y_size; j++) { + if (j) { + // terminate the previous line + terminal_send(curbuf->terminal, "\n", 1); + } + terminal_send(curbuf->terminal, (char *)y_array[j], STRLEN(y_array[j])); + } + } +} + void terminal_flush_output(Terminal *term) { size_t len = vterm_output_read(term->vt, term->textbuf, |