diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-25 06:50:31 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-25 06:50:31 +0200 |
commit | 5c381eb9e72990e4153045f4911c59b9b2194edd (patch) | |
tree | e45433591e73b72b4e31a84e6172eef77ac8534a /src/terminal.c | |
parent | 7d491c425334d9477637372a4ebec64c228c8430 (diff) | |
download | vim-git-5c381eb9e72990e4153045f4911c59b9b2194edd.tar.gz |
patch 8.1.1592: may start file dialog while exitingv8.1.1592
Problem: May start file dialog while exiting.
Solution: Ignore the "browse" modifier when exiting. (Ozaki Kiichi,
closes #4582
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/terminal.c b/src/terminal.c index 3511e0c80..93b081707 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -358,6 +358,16 @@ setup_job_options(jobopt_T *opt, int rows, int cols) } /* + * Flush messages on channels. + */ + static void +term_flush_messages() +{ + mch_check_messages(); + parse_queued_messages(); +} + +/* * Close a terminal buffer (and its window). Used when creating the terminal * fails. */ @@ -1455,8 +1465,7 @@ term_try_stop_job(buf_T *buf) return OK; ui_delay(10L, FALSE); - mch_check_messages(); - parse_queued_messages(); + term_flush_messages(); } return FAIL; } @@ -3064,7 +3073,7 @@ term_channel_closed(channel_T *ch) for (term = first_term; term != NULL; term = next_term) { next_term = term->tl_next; - if (term->tl_job == ch->ch_job) + if (term->tl_job == ch->ch_job && !term->tl_channel_closed) { term->tl_channel_closed = TRUE; did_one = TRUE; @@ -5628,33 +5637,31 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED) ch_log(NULL, "term_wait(): waiting for channel to close"); while (buf->b_term != NULL && !buf->b_term->tl_channel_closed) { - mch_check_messages(); - parse_queued_messages(); + term_flush_messages(); + ui_delay(10L, FALSE); if (!buf_valid(buf)) /* If the terminal is closed when the channel is closed the * buffer disappears. */ break; } - mch_check_messages(); - parse_queued_messages(); + + term_flush_messages(); } else { long wait = 10L; - mch_check_messages(); - parse_queued_messages(); + term_flush_messages(); /* Wait for some time for any channel I/O. */ if (argvars[1].v_type != VAR_UNKNOWN) wait = tv_get_number(&argvars[1]); ui_delay(wait, TRUE); - mch_check_messages(); /* Flushing messages on channels is hopefully sufficient. * TODO: is there a better way? */ - parse_queued_messages(); + term_flush_messages(); } } |