comparison src/testdir/test_timers.vim @ 15665:31367ce5aac7 v8.1.0840

patch 8.1.0840: getchar(0) never returns a character in the terminal commit https://github.com/vim/vim/commit/12dfc9eef14fe74c46145aa9e6cba9666f1bcd40 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 28 22:32:58 2019 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Jan 2019 22:45:05 +0100
parents eadecbe4e390
children d2ec272ae777
comparison
equal deleted inserted replaced
15664:128d7a4ccd54 15665:31367ce5aac7
246 call timer_start(0, 'FeedAndPeek') 246 call timer_start(0, 'FeedAndPeek')
247 let intr = timer_start(100, 'Interrupt') 247 let intr = timer_start(100, 'Interrupt')
248 let c = getchar() 248 let c = getchar()
249 call assert_equal(char2nr('a'), c) 249 call assert_equal(char2nr('a'), c)
250 call timer_stop(intr) 250 call timer_stop(intr)
251 endfunc
252
253 func Test_getchar_zero()
254 call timer_start(20, {id -> feedkeys('x', 'L')})
255 let c = 0
256 while c == 0
257 let c = getchar(0)
258 sleep 10m
259 endwhile
260 call assert_equal('x', nr2char(c))
251 endfunc 261 endfunc
252 262
253 func Test_ex_mode() 263 func Test_ex_mode()
254 " Function with an empty line. 264 " Function with an empty line.
255 func Foo(...) 265 func Foo(...)