Mercurial > vim
comparison src/eval.c @ 16231:0761a4c111a7 v8.1.1120
patch 8.1.1120: cannot easily get directory entry matches
commit https://github.com/vim/vim/commit/543c9b1921d7605498b54afdef518e312f1b4515
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 5 22:50:40 2019 +0200
patch 8.1.1120: cannot easily get directory entry matches
Problem: Cannot easily get directory entry matches.
Solution: Add the readdir() function. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/2439)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 05 Apr 2019 23:00:06 +0200 |
parents | abb67309c1ca |
children | 6ee80f3b5ea9 |
comparison
equal
deleted
inserted
replaced
16230:55efca92c30f | 16231:0761a4c111a7 |
---|---|
751 semsg(_(e_invexpr2), start); | 751 semsg(_(e_invexpr2), start); |
752 } | 752 } |
753 return ret; | 753 return ret; |
754 } | 754 } |
755 | 755 |
756 static int | 756 int |
757 eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv) | 757 eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv) |
758 { | 758 { |
759 char_u *s; | 759 char_u *s; |
760 int dummy; | 760 int dummy; |
761 char_u buf[NUMBUFLEN]; | 761 char_u buf[NUMBUFLEN]; |
964 /* | 964 /* |
965 * Prepare v: variable "idx" to be used. | 965 * Prepare v: variable "idx" to be used. |
966 * Save the current typeval in "save_tv". | 966 * Save the current typeval in "save_tv". |
967 * When not used yet add the variable to the v: hashtable. | 967 * When not used yet add the variable to the v: hashtable. |
968 */ | 968 */ |
969 static void | 969 void |
970 prepare_vimvar(int idx, typval_T *save_tv) | 970 prepare_vimvar(int idx, typval_T *save_tv) |
971 { | 971 { |
972 *save_tv = vimvars[idx].vv_tv; | 972 *save_tv = vimvars[idx].vv_tv; |
973 if (vimvars[idx].vv_type == VAR_UNKNOWN) | 973 if (vimvars[idx].vv_type == VAR_UNKNOWN) |
974 hash_add(&vimvarht, vimvars[idx].vv_di.di_key); | 974 hash_add(&vimvarht, vimvars[idx].vv_di.di_key); |
976 | 976 |
977 /* | 977 /* |
978 * Restore v: variable "idx" to typeval "save_tv". | 978 * Restore v: variable "idx" to typeval "save_tv". |
979 * When no longer defined, remove the variable from the v: hashtable. | 979 * When no longer defined, remove the variable from the v: hashtable. |
980 */ | 980 */ |
981 static void | 981 void |
982 restore_vimvar(int idx, typval_T *save_tv) | 982 restore_vimvar(int idx, typval_T *save_tv) |
983 { | 983 { |
984 hashitem_T *hi; | 984 hashitem_T *hi; |
985 | 985 |
986 vimvars[idx].vv_tv = *save_tv; | 986 vimvars[idx].vv_tv = *save_tv; |