chore: move check for paste size

This commit is contained in:
Dylan Armstrong
2021-04-02 12:49:36 -05:00
parent 6646280d1a
commit 42d2bbe7d0
2 changed files with 4 additions and 1 deletions

View File

@@ -2971,7 +2971,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
y_array = reg->y_array; y_array = reg->y_array;
} }
if (y_size > 0 && curbuf->terminal) { if (curbuf->terminal) {
terminal_paste(count, y_array, y_size); terminal_paste(count, y_array, y_size);
return; return;
} }

View File

@@ -569,6 +569,9 @@ static bool is_filter_char(int c)
void terminal_paste(long count, char_u **y_array, size_t y_size) void terminal_paste(long count, char_u **y_array, size_t y_size)
{ {
if (y_size == 0) {
return;
}
vterm_keyboard_start_paste(curbuf->terminal->vt); vterm_keyboard_start_paste(curbuf->terminal->vt);
terminal_flush_output(curbuf->terminal); terminal_flush_output(curbuf->terminal);
size_t buff_len = STRLEN(y_array[0]); size_t buff_len = STRLEN(y_array[0]);