Mercurial > vim
comparison src/eval.c @ 1650:e1c7d0ea5dac v7.2a.002
updated for version 7.2a-002
author | vimboss |
---|---|
date | Fri, 27 Jun 2008 18:26:11 +0000 |
parents | 18ee39301b82 |
children | d166fe2bfe74 |
comparison
equal
deleted
inserted
replaced
1649:68f005107052 | 1650:e1c7d0ea5dac |
---|---|
10440 rettv->v_type = VAR_STRING; | 10440 rettv->v_type = VAR_STRING; |
10441 rettv->vval.v_string = NULL; | 10441 rettv->vval.v_string = NULL; |
10442 | 10442 |
10443 if (buf != NULL && varname != NULL) | 10443 if (buf != NULL && varname != NULL) |
10444 { | 10444 { |
10445 /* set curbuf to be our buf, temporarily */ | |
10446 save_curbuf = curbuf; | |
10447 curbuf = buf; | |
10448 | |
10445 if (*varname == '&') /* buffer-local-option */ | 10449 if (*varname == '&') /* buffer-local-option */ |
10446 { | |
10447 /* set curbuf to be our buf, temporarily */ | |
10448 save_curbuf = curbuf; | |
10449 curbuf = buf; | |
10450 | |
10451 get_option_tv(&varname, rettv, TRUE); | 10450 get_option_tv(&varname, rettv, TRUE); |
10452 | |
10453 /* restore previous notion of curbuf */ | |
10454 curbuf = save_curbuf; | |
10455 } | |
10456 else | 10451 else |
10457 { | 10452 { |
10458 if (*varname == NUL) | 10453 if (*varname == NUL) |
10459 /* let getbufvar({nr}, "") return the "b:" dictionary. The | 10454 /* let getbufvar({nr}, "") return the "b:" dictionary. The |
10460 * scope prefix before the NUL byte is required by | 10455 * scope prefix before the NUL byte is required by |
10461 * find_var_in_ht(). */ | 10456 * find_var_in_ht(). */ |
10462 varname = (char_u *)"b:" + 2; | 10457 varname = (char_u *)"b:" + 2; |
10463 /* look up the variable */ | 10458 /* look up the variable */ |
10464 v = find_var_in_ht(&buf->b_vars.dv_hashtab, varname, FALSE); | 10459 v = find_var_in_ht(&curbuf->b_vars.dv_hashtab, varname, FALSE); |
10465 if (v != NULL) | 10460 if (v != NULL) |
10466 copy_tv(&v->di_tv, rettv); | 10461 copy_tv(&v->di_tv, rettv); |
10467 } | 10462 } |
10463 | |
10464 /* restore previous notion of curbuf */ | |
10465 curbuf = save_curbuf; | |
10468 } | 10466 } |
10469 | 10467 |
10470 --emsg_off; | 10468 --emsg_off; |
10471 } | 10469 } |
10472 | 10470 |