diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-07 22:11:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-07 22:11:27 +0100 |
commit | 6e65d594aa33be11f6074f26e9ff81b52504c62b (patch) | |
tree | a3c542e974c6c576792e6b3c7541907926e1b445 /src/eval.c | |
parent | 23c1b2b018c8121ca5fcc247e37966428bf8ca66 (diff) | |
download | vim-git-6e65d594aa33be11f6074f26e9ff81b52504c62b.tar.gz |
patch 8.0.1377: cannot call a dict function in autoloaded dictv8.0.1377
Problem: Cannot call a dict function in autoloaded dict.
Solution: Call get_lval() passing the read-only flag.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index b3e2be5d0..1cced57ec 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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) |