diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-02-19 23:10:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-02-19 23:10:02 +0100 |
commit | 7a76092a51fc5446426a4bfd9eb6503ec61bf9e9 (patch) | |
tree | 8611ab3fbe9f232764ad5a9dc944c0c8aed807e3 /src | |
parent | 9c8816bd306a003c2ac3dce161be3fef481c9902 (diff) |
patch 8.0.1525: using :wqa exits even if a job runs in a terminal windowv8.0.1525
Problem: Using :wqa exits even if a job runs in a terminal window. (Jason
Felice)
Solution: Check if a terminal has a running job. (closes #2654)
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.c | 4 | ||||
-rw-r--r-- | src/ex_cmds.c | 8 | ||||
-rw-r--r-- | src/ex_cmds2.c | 2 | ||||
-rw-r--r-- | src/proto/buffer.pro | 2 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 23 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index c3e0c50801..a3a7e00c47 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1875,10 +1875,10 @@ no_write_message(void) } void -no_write_message_nobang(void) +no_write_message_nobang(buf_T *buf UNUSED) { #ifdef FEAT_TERMINAL - if (term_job_running(curbuf->b_term)) + if (term_job_running(buf->b_term)) EMSG(_("E948: Job still running")); else #endif diff --git a/src/ex_cmds.c b/src/ex_cmds.c index a4d6221b01..e05215a596 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3428,6 +3428,14 @@ do_wqall(exarg_T *eap) FOR_ALL_BUFFERS(buf) { +#ifdef FEAT_TERMINAL + if (exiting && term_job_running(buf->b_term)) + { + no_write_message_nobang(buf); + ++error; + } + else +#endif if (bufIsChanged(buf) && !bt_dontwrite(buf)) { /* diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 6476d55169..805e8c4587 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -2110,7 +2110,7 @@ check_changed(buf_T *buf, int flags) if (flags & CCGD_EXCMD) no_write_message(); else - no_write_message_nobang(); + no_write_message_nobang(curbuf); return TRUE; } return FALSE; diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro index 485eb027de..8b98843547 100644 --- a/src/proto/buffer.pro +++ b/src/proto/buffer.pro @@ -14,7 +14,7 @@ void set_curbuf(buf_T *buf, int action); void enter_buffer(buf_T *buf); void do_autochdir(void); void no_write_message(void); -void no_write_message_nobang(void); +void no_write_message_nobang(buf_T *buf); buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags); void free_buf_options(buf_T *buf, int free_p_ff); int buflist_getfile(int n, linenr_T lnum, int options, int forceit); diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 0c2e289c10..ac54bbc1e1 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -712,6 +712,15 @@ func Test_terminal_wall() unlet g:job endfunc +func Test_terminal_wqall() + let buf = Run_shell_in_terminal({}) + call assert_fails('wqall', 'E948') + call Stop_shell_in_terminal(buf) + call term_wait(buf) + exe buf . 'bwipe' + unlet g:job +endfunc + func Test_terminal_composing_unicode() let save_enc = &encoding set encoding=utf-8 diff --git a/src/version.c b/src/version.c index 78b8431d17..3bed185ec3 100644 --- a/src/version.c +++ b/src/version.c @@ -772,6 +772,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1525, +/**/ 1524, /**/ 1523, |