comparison src/evalfunc.c @ 22053:0794909e2988 v8.2.1576

patch 8.2.1576: Vim9: index() does not take "true" as argument Commit: https://github.com/vim/vim/commit/6c553f9c04a698ac2e19584f8ea8e2cb7cd98c80 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 2 22:10:34 2020 +0200 patch 8.2.1576: Vim9: index() does not take "true" as argument Problem: Vim9: index() does not take "true" as argument. Solution: Use tv_get_bool_chk(). (closes https://github.com/vim/vim/issues/6823)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Sep 2020 22:15:03 +0200
parents ed6165395d7b
children 88bedbb4ba75
comparison
equal deleted inserted replaced
22052:ca8884cbf94b 22053:0794909e2988
4942 // Start at specified item. Use the cached index that list_find() 4942 // Start at specified item. Use the cached index that list_find()
4943 // sets, so that a negative number also works. 4943 // sets, so that a negative number also works.
4944 item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error)); 4944 item = list_find(l, (long)tv_get_number_chk(&argvars[2], &error));
4945 idx = l->lv_u.mat.lv_idx; 4945 idx = l->lv_u.mat.lv_idx;
4946 if (argvars[3].v_type != VAR_UNKNOWN) 4946 if (argvars[3].v_type != VAR_UNKNOWN)
4947 ic = (int)tv_get_number_chk(&argvars[3], &error); 4947 ic = (int)tv_get_bool_chk(&argvars[3], &error);
4948 if (error) 4948 if (error)
4949 item = NULL; 4949 item = NULL;
4950 } 4950 }
4951 4951
4952 for ( ; item != NULL; item = item->li_next, ++idx) 4952 for ( ; item != NULL; item = item->li_next, ++idx)