aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-03 22:43:06 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-03 22:43:52 -0500
commita2554858df533fcfa0ba6074648e21cda50934d9 (patch)
tree50f4499f7dacdecdcee7611b1fd1442b72440096
parent4c4bcecc4a1b817be742856ac8600c90d24c42f4 (diff)
downloadrneovim-a2554858df533fcfa0ba6074648e21cda50934d9.tar.gz
rneovim-a2554858df533fcfa0ba6074648e21cda50934d9.tar.bz2
rneovim-a2554858df533fcfa0ba6074648e21cda50934d9.zip
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
-rw-r--r--src/nvim/testdir/test_timers.vim10
1 files changed, 10 insertions, 0 deletions
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(...)