comparison src/eval.c @ 13002:f7b2ecaeb79c v8.0.1377

patch 8.0.1377: cannot call a dict function in autoloaded dict commit https://github.com/vim/vim/commit/6e65d594aa33be11f6074f26e9ff81b52504c62b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 7 22:11:27 2017 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 07 Dec 2017 22:15:06 +0100
parents 9c1659761fc3
children 6e81a68d63a1
comparison
equal deleted inserted replaced
13001:b5a93ba1f01a 13002:f7b2ecaeb79c
1954 if ((*p != '[' && *p != '.') || lp->ll_name == NULL) 1954 if ((*p != '[' && *p != '.') || lp->ll_name == NULL)
1955 return p; 1955 return p;
1956 1956
1957 cc = *p; 1957 cc = *p;
1958 *p = NUL; 1958 *p = NUL;
1959 v = find_var(lp->ll_name, &ht, flags & GLV_NO_AUTOLOAD); 1959 /* Only pass &ht when we would write to the variable, it prevents autoload
1960 * as well. */
1961 v = find_var(lp->ll_name, (flags & GLV_READ_ONLY) ? NULL : &ht,
1962 flags & GLV_NO_AUTOLOAD);
1960 if (v == NULL && !quiet) 1963 if (v == NULL && !quiet)
1961 EMSG2(_(e_undefvar), lp->ll_name); 1964 EMSG2(_(e_undefvar), lp->ll_name);
1962 *p = cc; 1965 *p = cc;
1963 if (v == NULL) 1966 if (v == NULL)
1964 return NULL; 1967 return NULL;
6608 return vimvars[idx].vv_nr; 6611 return vimvars[idx].vv_nr;
6609 } 6612 }
6610 6613
6611 /* 6614 /*
6612 * Get string v: variable value. Uses a static buffer, can only be used once. 6615 * Get string v: variable value. Uses a static buffer, can only be used once.
6616 * If the String variable has never been set, return an empty string.
6617 * Never returns NULL;
6613 */ 6618 */
6614 char_u * 6619 char_u *
6615 get_vim_var_str(int idx) 6620 get_vim_var_str(int idx)
6616 { 6621 {
6617 return get_tv_string(&vimvars[idx].vv_tv); 6622 return get_tv_string(&vimvars[idx].vv_tv);