]> granicus.if.org Git - vim/commitdiff
patch 8.0.1525: using :wqa exits even if a job runs in a terminal window v8.0.1525
authorBram Moolenaar <Bram@vim.org>
Mon, 19 Feb 2018 22:10:02 +0000 (23:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 19 Feb 2018 22:10:02 +0000 (23:10 +0100)
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)

src/buffer.c
src/ex_cmds.c
src/ex_cmds2.c
src/proto/buffer.pro
src/testdir/test_terminal.vim
src/version.c

index c3e0c50801d0e353eff050c720735a2f62724b7a..a3a7e00c47bdce4ff51c977e30aee8828ab5573a 100644 (file)
@@ -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
index a4d6221b013e91be27d85e9334ea04940a31a983..e05215a596ee40e987d26adedab2cac6477509be 100644 (file)
@@ -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))
        {
            /*
index 6476d55169bd9d4156f989255d0679ce84a602cc..805e8c4587628650f13b180f7824a7e5e535e6c0 100644 (file)
@@ -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;
index 485eb027de95d119bd1fa2c3d8e8d48e3741065f..8b98843547ed3f6e00195e860a99b915d732f6e0 100644 (file)
@@ -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);
index 0c2e289c10cca3bd2f5201f5f388a06e5ef7d873..ac54bbc1e1af4c30b8d2edfe601fb75eceb0548e 100644 (file)
@@ -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
index 78b8431d1713930b9c8c01c1e85b8543189a2aa6..3bed185ec3aee3a482ef9fe56c87bc5a9071e43a 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1525,
 /**/
     1524,
 /**/