diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-18 19:11:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-18 19:11:38 +0200 |
commit | e15eebd202e739ec7821a0e9c2aa72a445668bb8 (patch) | |
tree | d58ed5a6235ae2a87713ecb9c8553a59634687d4 /src/typval.c | |
parent | 1d634542cf5ebcd1d5d83bd124b3e1d5e7c96c58 (diff) | |
download | vim-git-e15eebd202e739ec7821a0e9c2aa72a445668bb8.tar.gz |
patch 8.2.1480: Vim9: skip expression in search() gives errorv8.2.1480
Problem: Vim9: skip expression in search() gives error.
Solution: use tv_get_bool() eval_expr_to_bool(). (closes #6729)
Diffstat (limited to 'src/typval.c')
-rw-r--r-- | src/typval.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c index 053f30077..2203bc6fa 100644 --- a/src/typval.c +++ b/src/typval.c @@ -270,6 +270,17 @@ tv_get_bool(typval_T *varp) } +/* + * Get the boolean value of "varp". This is like tv_get_number_chk(), + * but in Vim9 script accepts Number and Bool. + */ + varnumber_T +tv_get_bool_chk(typval_T *varp, int *denote) +{ + return tv_get_bool_or_number_chk(varp, denote, TRUE); + +} + #ifdef FEAT_FLOAT float_T tv_get_float(typval_T *varp) |