patch 9.1.1356: Vim9: crash when unletting variable

Problem:  Vim9: crash when unletting variable
Solution: fix crash, allow to use :unlet
          (Hirohito Higashi)

closes: #17226

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2025-05-01 08:56:39 +02:00
committed by Christian Brabandt
parent f57c065e75
commit f5bfc48c05
5 changed files with 17 additions and 18 deletions

View File

@ -99,7 +99,7 @@ check_vim9_unlet(char_u *name)
if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL)
{
// "unlet s:var" is allowed in legacy script.
if (*name == 's' && !script_is_vim9())
if (*name == 's' && !in_vim9script())
return OK;
semsg(_(e_cannot_unlet_str), name);
return FAIL;