mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
vim-patch:7.4.1816 (#5833)
Problem: Looping over a null list throws an error.
Solution: Skip over the for loop.
d8585eded6
This commit is contained in:

committed by
Justin M. Keyes

parent
4431975210
commit
a6b14dbb0b
@@ -2621,9 +2621,12 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip)
|
||||
*errp = FALSE;
|
||||
if (!skip) {
|
||||
l = tv.vval.v_list;
|
||||
if (tv.v_type != VAR_LIST || l == NULL) {
|
||||
if (tv.v_type != VAR_LIST) {
|
||||
EMSG(_(e_listreq));
|
||||
clear_tv(&tv);
|
||||
} else if (l == NULL) {
|
||||
// a null list is like an empty list: do nothing
|
||||
clear_tv(&tv);
|
||||
} else {
|
||||
/* No need to increment the refcount, it's already set for the
|
||||
* list being used in "tv". */
|
||||
|
Reference in New Issue
Block a user