vim-patch:7.4.725

Problem:    ":call setreg('"', [])" reports an internal error.
Solution:   Make the register empty. (Yasuhiro Matsumoto)
659c94d483

Required for v8.2.1035.

Note that setreg('"', []) didn't cause an internal error for us, but
didn't clear the register properly either...
This commit is contained in:
Sean Dewar 2021-09-22 23:43:42 +01:00
parent f9779facca
commit f8241f825a
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581

View File

@ -5560,6 +5560,11 @@ static void str_to_reg(yankreg_T *y_ptr, MotionType yank_type, const char_u *str
}
}
// Without any lines make the register empty.
if (y_ptr->y_size + newlines == 0) {
XFREE_CLEAR(y_ptr->y_array);
return;
}
// Grow the register array to hold the pointers to the new lines.
char_u **pp = xrealloc(y_ptr->y_array,