mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2878: Vim9: for loop list unpack only allows for one "_"
Problem: Vim9: for loop list unpack only allows for one "_". Solution: Drop the value when the variable is "_". (closes #8232)
This commit is contained in:
@@ -7776,6 +7776,12 @@ compile_for(char_u *arg_start, cctx_T *cctx)
|
||||
0, 0, type, name) == FAIL)
|
||||
goto failed;
|
||||
}
|
||||
else if (varlen == 1 && *arg == '_')
|
||||
{
|
||||
// Assigning to "_": drop the value.
|
||||
if (generate_instr_drop(cctx, ISN_DROP, 1) == NULL)
|
||||
goto failed;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lookup_local(arg, varlen, NULL, cctx) == OK)
|
||||
|
Reference in New Issue
Block a user