Mercurial > vim
changeset 22157:ba81f5e300b7 v8.2.1628
patch 8.2.1628: Vim9: cannot pass "true" to timer_paused()
Commit: https://github.com/vim/vim/commit/418155def2aa45afd7fc034db341dc874b00af3a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 6 18:39:38 2020 +0200
patch 8.2.1628: Vim9: cannot pass "true" to timer_paused()
Problem: Vim9: cannot pass "true" to timer_paused().
Solution: Use tv_get_bool(). (closes https://github.com/vim/vim/issues/6891)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Sep 2020 18:45:03 +0200 |
parents | 76e97e930c32 |
children | 3ba89b3ea99c |
files | src/testdir/test_vim9_func.vim src/time.c src/version.c |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1678,6 +1678,14 @@ def Test_term_start() bwipe! enddef +def Test_timer_paused() + let id = timer_start(50, {-> 0}) + timer_pause(id, true) + let info = timer_info(id) + assert_equal(1, info[0]['paused']) + timer_stop(id) +enddef + def Test_win_splitmove() split win_splitmove(1, 2, #{vertical: true, rightbelow: true})
--- a/src/time.c +++ b/src/time.c @@ -742,7 +742,7 @@ f_timer_info(typval_T *argvars, typval_T f_timer_pause(typval_T *argvars, typval_T *rettv UNUSED) { timer_T *timer = NULL; - int paused = (int)tv_get_number(&argvars[1]); + int paused = (int)tv_get_bool(&argvars[1]); if (argvars[0].v_type != VAR_NUMBER) emsg(_(e_number_exp));