Mercurial > vim
comparison src/terminal.c @ 12007:64b822c4f7ae v8.0.0884
patch 8.0.0884: can't specify the wait time for term_wait()
commit https://github.com/vim/vim/commit/f3402b1b7f72d08e0357196902cce972b639bfd7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 6 19:07:08 2017 +0200
patch 8.0.0884: can't specify the wait time for term_wait()
Problem: Can't specify the wait time for term_wait().
Solution: Add an otional second argument.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 06 Aug 2017 19:15:05 +0200 |
parents | 92a86fe8adc0 |
children | 0d9bfdb3f6f7 |
comparison
equal
deleted
inserted
replaced
12006:bf3f53363054 | 12007:64b822c4f7ae |
---|---|
34 * | 34 * |
35 * When the job ends the text is put in a buffer. Redrawing then happens from | 35 * When the job ends the text is put in a buffer. Redrawing then happens from |
36 * that buffer, attributes come from the scrollback buffer tl_scrollback. | 36 * that buffer, attributes come from the scrollback buffer tl_scrollback. |
37 * | 37 * |
38 * TODO: | 38 * TODO: |
39 * - Add argument to term_wait() for waiting time. | |
40 * - For the scrollback buffer store lines in the buffer, only attributes in | 39 * - For the scrollback buffer store lines in the buffer, only attributes in |
41 * tl_scrollback. | 40 * tl_scrollback. |
42 * - When the job ends: | 41 * - When the job ends: |
43 * - Need an option or argument to drop the window+buffer right away, to be | 42 * - Need an option or argument to drop the window+buffer right away, to be |
44 * used for a shell or Vim. 'termfinish'; "close", "open" (open window when | 43 * used for a shell or Vim. 'termfinish'; "close", "open" (open window when |
2246 mch_check_messages(); | 2245 mch_check_messages(); |
2247 parse_queued_messages(); | 2246 parse_queued_messages(); |
2248 } | 2247 } |
2249 else | 2248 else |
2250 { | 2249 { |
2250 long wait = 10L; | |
2251 | |
2251 mch_check_messages(); | 2252 mch_check_messages(); |
2252 parse_queued_messages(); | 2253 parse_queued_messages(); |
2253 | 2254 |
2254 /* Wait for 10 msec for any channel I/O. */ | 2255 /* Wait for some time for any channel I/O. */ |
2255 /* TODO: use delay from optional argument */ | 2256 if (argvars[1].v_type != VAR_UNKNOWN) |
2256 ui_delay(10L, TRUE); | 2257 wait = get_tv_number(&argvars[1]); |
2258 ui_delay(wait, TRUE); | |
2257 mch_check_messages(); | 2259 mch_check_messages(); |
2258 | 2260 |
2259 /* Flushing messages on channels is hopefully sufficient. | 2261 /* Flushing messages on channels is hopefully sufficient. |
2260 * TODO: is there a better way? */ | 2262 * TODO: is there a better way? */ |
2261 parse_queued_messages(); | 2263 parse_queued_messages(); |