Patch 8.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)
Files:      src/ex_cmds2.c, src/buffer.c, src/proto/buffer.pro, src/ex_cmds.c,
            src/testdir/test_terminal.vim


*** ../vim-8.0.1524/src/ex_cmds2.c      2018-02-13 12:57:38.062977642 +0100
--- src/ex_cmds2.c      2018-02-19 22:56:51.051149398 +0100
***************
*** 2110,2116 ****
        if (flags & CCGD_EXCMD)
            no_write_message();
        else
!           no_write_message_nobang();
        return TRUE;
      }
      return FALSE;
--- 2110,2116 ----
        if (flags & CCGD_EXCMD)
            no_write_message();
        else
!           no_write_message_nobang(curbuf);
        return TRUE;
      }
      return FALSE;
*** ../vim-8.0.1524/src/buffer.c        2018-02-10 18:45:21.040822359 +0100
--- src/buffer.c        2018-02-19 22:57:08.279019458 +0100
***************
*** 1875,1884 ****
  }
  
      void
! no_write_message_nobang(void)
  {
  #ifdef FEAT_TERMINAL
!     if (term_job_running(curbuf->b_term))
        EMSG(_("E948: Job still running"));
      else
  #endif
--- 1875,1884 ----
  }
  
      void
! no_write_message_nobang(buf_T *buf UNUSED)
  {
  #ifdef FEAT_TERMINAL
!     if (term_job_running(buf->b_term))
        EMSG(_("E948: Job still running"));
      else
  #endif
*** ../vim-8.0.1524/src/proto/buffer.pro        2017-08-17 16:55:08.633414785 
+0200
--- src/proto/buffer.pro        2018-02-19 22:57:56.722653983 +0100
***************
*** 14,20 ****
  void enter_buffer(buf_T *buf);
  void do_autochdir(void);
  void no_write_message(void);
! void no_write_message_nobang(void);
  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);
--- 14,20 ----
  void enter_buffer(buf_T *buf);
  void do_autochdir(void);
  void no_write_message(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);
*** ../vim-8.0.1524/src/ex_cmds.c       2018-02-13 13:12:06.585200192 +0100
--- src/ex_cmds.c       2018-02-19 23:08:26.046272559 +0100
***************
*** 3428,3433 ****
--- 3428,3441 ----
  
      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))
        {
            /*
*** ../vim-8.0.1524/src/testdir/test_terminal.vim       2018-02-02 
18:30:31.643086057 +0100
--- src/testdir/test_terminal.vim       2018-02-19 23:08:04.962422609 +0100
***************
*** 712,717 ****
--- 712,726 ----
    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
*** ../vim-8.0.1524/src/version.c       2018-02-19 21:50:38.346102072 +0100
--- src/version.c       2018-02-19 23:01:25.461191976 +0100
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1525,
  /**/

-- 
ROBIN:  The what?
ARTHUR: The Holy Hand Grenade of Antioch.  'Tis one of the sacred relics
        Brother Maynard always carries with him.
ALL:    Yes. Of course.
ARTHUR: (shouting) Bring up the Holy Hand Grenade!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui