To: vim_dev@googlegroups.com Subject: Patch 8.0.0884 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0884 Problem: Can't specify the wait time for term_wait(). Solution: Add an otional second argument. Files: src/evalfunc.c, src/terminal.c, runtime/doc/eval.txt *** ../vim-8.0.0883/src/evalfunc.c 2017-08-06 17:53:06.575447867 +0200 --- src/evalfunc.c 2017-08-06 18:36:48.668512941 +0200 *************** *** 843,849 **** {"term_scrape", 2, 2, f_term_scrape}, {"term_sendkeys", 2, 2, f_term_sendkeys}, {"term_start", 1, 2, f_term_start}, ! {"term_wait", 1, 1, f_term_wait}, #endif {"test_alloc_fail", 3, 3, f_test_alloc_fail}, {"test_autochdir", 0, 0, f_test_autochdir}, --- 843,849 ---- {"term_scrape", 2, 2, f_term_scrape}, {"term_sendkeys", 2, 2, f_term_sendkeys}, {"term_start", 1, 2, f_term_start}, ! {"term_wait", 1, 2, f_term_wait}, #endif {"test_alloc_fail", 3, 3, f_test_alloc_fail}, {"test_autochdir", 0, 0, f_test_autochdir}, *** ../vim-8.0.0883/src/terminal.c 2017-08-06 14:57:44.939764548 +0200 --- src/terminal.c 2017-08-06 19:04:19.364754742 +0200 *************** *** 36,42 **** * that buffer, attributes come from the scrollback buffer tl_scrollback. * * TODO: - * - Add argument to term_wait() for waiting time. * - For the scrollback buffer store lines in the buffer, only attributes in * tl_scrollback. * - When the job ends: --- 36,41 ---- *************** *** 2248,2259 **** } else { mch_check_messages(); parse_queued_messages(); ! /* Wait for 10 msec for any channel I/O. */ ! /* TODO: use delay from optional argument */ ! ui_delay(10L, TRUE); mch_check_messages(); /* Flushing messages on channels is hopefully sufficient. --- 2247,2261 ---- } else { + long wait = 10L; + mch_check_messages(); parse_queued_messages(); ! /* Wait for some time for any channel I/O. */ ! if (argvars[1].v_type != VAR_UNKNOWN) ! wait = get_tv_number(&argvars[1]); ! ui_delay(wait, TRUE); mch_check_messages(); /* Flushing messages on channels is hopefully sufficient. *** ../vim-8.0.0883/runtime/doc/eval.txt 2017-08-06 17:53:06.579447838 +0200 --- runtime/doc/eval.txt 2017-08-06 18:36:33.652619633 +0200 *************** *** 2381,2387 **** term_scrape({buf}, {row}) List get row of a terminal screen term_sendkeys({buf}, {keys}) none send keystrokes to a terminal term_start({cmd}, {options}) Job open a terminal window and run a job ! term_wait({buf}) Number wait for screen to be updated test_alloc_fail({id}, {countdown}, {repeat}) none make memory allocation fail test_autochdir() none enable 'autochdir' during startup --- 2381,2387 ---- term_scrape({buf}, {row}) List get row of a terminal screen term_sendkeys({buf}, {keys}) none send keystrokes to a terminal term_start({cmd}, {options}) Job open a terminal window and run a job ! term_wait({buf} [, {time}]) Number wait for screen to be updated test_alloc_fail({id}, {countdown}, {repeat}) none make memory allocation fail test_autochdir() none enable 'autochdir' during startup *************** *** 8033,8041 **** the command name. {only available when compiled with the |+terminal| feature} ! term_wait({buf}) *term_wait()* Wait for pending updates of {buf} to be handled. {buf} is used as with |term_getsize()|. {only available when compiled with the |+terminal| feature} test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* --- 8041,8051 ---- the command name. {only available when compiled with the |+terminal| feature} ! term_wait({buf} [, {time}]) *term_wait()* Wait for pending updates of {buf} to be handled. {buf} is used as with |term_getsize()|. + {time} is how long to wait for updates to arrive in msec. If + not set then 10 msec will be used. {only available when compiled with the |+terminal| feature} test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* *** ../vim-8.0.0883/src/version.c 2017-08-06 18:15:40.349643148 +0200 --- src/version.c 2017-08-06 19:05:16.372354363 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 884, /**/ -- ROBIN: The what? ARTHUR: The Holy Hand Grenade of Antioch. 'Tis one of the sacred relics Brother Maynard always carries with him. ALL: Yes. Of course. ARTHUR: (shouting) Bring up the Holy Hand Grenade! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///