mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.1377: cannot call a dict function in autoloaded dict
Problem: Cannot call a dict function in autoloaded dict. Solution: Call get_lval() passing the read-only flag.
This commit is contained in:
@@ -1956,7 +1956,10 @@ get_lval(
|
||||
|
||||
cc = *p;
|
||||
*p = NUL;
|
||||
v = find_var(lp->ll_name, &ht, flags & GLV_NO_AUTOLOAD);
|
||||
/* Only pass &ht when we would write to the variable, it prevents autoload
|
||||
* as well. */
|
||||
v = find_var(lp->ll_name, (flags & GLV_READ_ONLY) ? NULL : &ht,
|
||||
flags & GLV_NO_AUTOLOAD);
|
||||
if (v == NULL && !quiet)
|
||||
EMSG2(_(e_undefvar), lp->ll_name);
|
||||
*p = cc;
|
||||
@@ -6610,6 +6613,8 @@ get_vim_var_nr(int idx)
|
||||
|
||||
/*
|
||||
* Get string v: variable value. Uses a static buffer, can only be used once.
|
||||
* If the String variable has never been set, return an empty string.
|
||||
* Never returns NULL;
|
||||
*/
|
||||
char_u *
|
||||
get_vim_var_str(int idx)
|
||||
|
Reference in New Issue
Block a user