diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-06-02 20:05:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-06-02 20:05:26 +0200 |
commit | cf7c11a9479ba7ce775b86c7a846fae48321d260 (patch) | |
tree | 58b3a7cd04f178bab618232b2eb3f0e4af9a1d93 /src/os_unix.c | |
parent | 01d46e41ba4967ee534db4b94ad642007634841e (diff) | |
download | vim-git-cf7c11a9479ba7ce775b86c7a846fae48321d260.tar.gz |
patch 7.4.1878v7.4.1878
Problem: Whether a job has exited isn't detected until a character is
typed. After calling exit_cb the cursor is in the wrong place.
Solution: Don't wait forever for a character to be typed when there is a
pending job. Update the screen if neede after calling exit_cb.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index f7b5ae4b1..b4808b5fe 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -438,17 +438,31 @@ mch_inchar( for (;;) /* repeat until we got a character */ { + long wtime_now = -1L; + while (do_resize) /* window changed size */ handle_resize(); #ifdef MESSAGE_QUEUE parse_queued_messages(); + +# ifdef FEAT_JOB_CHANNEL + if (has_pending_job()) + { + /* Don't wait longer than a few seconds, checking for a finished + * job requires polling. */ + if (p_ut > 9000L) + wtime_now = 1000L; + else + wtime_now = 10000L - p_ut; + } +# endif #endif /* * We want to be interrupted by the winch signal * or by an event on the monitored file descriptors. */ - if (!WaitForChar(-1L)) + if (!WaitForChar(wtime_now)) { if (do_resize) /* interrupted by SIGWINCH signal */ handle_resize(); |