0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1603: Vim9: cannot use "true" with getchar()

Problem:    Vim9: cannot use "true" with getchar().
Solution:   use tv_get_bool_chk(). (closes #6874)
This commit is contained in:
Bram Moolenaar
2020-09-05 17:51:23 +02:00
parent 036c2cf719
commit c08cc72947
3 changed files with 7 additions and 1 deletions

View File

@@ -2037,7 +2037,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
if (argvars[0].v_type == VAR_UNKNOWN)
// getchar(): blocking wait.
n = plain_vgetc();
else if (tv_get_number_chk(&argvars[0], &error) == 1)
else if (tv_get_bool_chk(&argvars[0], &error))
// getchar(1): only check if char avail
n = vpeekc_any();
else if (error || vpeekc_any() == NUL)