From a2554858df533fcfa0ba6074648e21cda50934d9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 3 Jan 2020 22:43:06 -0500 Subject: vim-patch:8.1.0840: getchar(0) never returns a character in the terminal Problem: getchar(0) never returns a character in the terminal. Solution: Call wait_func() at least once. https://github.com/vim/vim/commit/12dfc9eef14fe74c46145aa9e6cba9666f1bcd40 --- src/nvim/testdir/test_timers.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index cadec88af9..161a89c38c 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -253,6 +253,16 @@ func Test_peek_and_get_char() call timer_stop(intr) endfunc +func Test_getchar_zero() + call timer_start(20, {id -> feedkeys('x', 'L')}) + let c = 0 + while c == 0 + let c = getchar(0) + sleep 10m + endwhile + call assert_equal('x', nr2char(c)) +endfunc + func Test_ex_mode() " Function with an empty line. func Foo(...) -- cgit