Patch 8.0.1131
Problem:    It is not easy to trigger an autocommand for new terminal window.
            (Marco Restelli)
Solution:   Trigger BufWinEnter after setting 'buftype'.
Files:      src/terminal.c, src/testdir/test_terminal.c


*** ../vim-8.0.1130/src/terminal.c      2017-09-18 21:23:02.938622902 +0200
--- src/terminal.c      2017-09-21 22:05:21.397401688 +0200
***************
*** 38,48 ****
--- 38,51 ----
   * in tl_scrollback are no longer used.
   *
   * TODO:
+  * - in GUI vertical split causes problems.  Cursor is flickering. (Hirohito
+  *   Higashi, 2017 Sep 19)
   * - Shift-Tab does not work.
   * - click in Window toolbar of other window: save/restore Insert and Visual
   * - Redirecting output does not work on MS-Windows, 
Test_terminal_redir_file()
   *   is disabled.
   * - implement term_setsize()
+  * - MS-Windows GUI: still need to type a key after shell exits?  #1924
   * - add test for giving error for invalid 'termsize' value.
   * - support minimal size when 'termsize' is "rows*cols".
   * - support minimal size when 'termsize' is empty?
***************
*** 445,450 ****
--- 448,459 ----
         * a deadlock if the job is waiting for Vim to read. */
        channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
  
+ #ifdef FEAT_AUTOCMD
+       ++curbuf->b_locked;
+       apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
+       --curbuf->b_locked;
+ #endif
+ 
        if (old_curbuf != NULL)
        {
            --curbuf->b_nwindows;
*** ../vim-8.0.1130/src/testdir/test_terminal.vim       2017-09-17 
19:07:58.524464106 +0200
--- src/testdir/test_terminal.vim       2017-09-21 22:14:50.041895614 +0200
***************
*** 34,40 ****
--- 34,42 ----
  endfunc
  
  func Test_terminal_basic()
+   au BufWinEnter * if &buftype == 'terminal' | let b:done = 'yes' | endif
    let buf = Run_shell_in_terminal({})
+ 
    if has("unix")
      call assert_match('^/dev/', job_info(g:job).tty_out)
      call assert_match('^/dev/', term_gettty(''))
***************
*** 43,48 ****
--- 45,51 ----
      call assert_match('^\\\\.\\pipe\\', term_gettty(''))
    endif
    call assert_equal('t', mode())
+   call assert_equal('yes', b:done)
    call assert_match('%aR[^\n]*running]', execute('ls'))
  
    call Stop_shell_in_terminal(buf)
***************
*** 54,59 ****
--- 57,63 ----
    close
    call assert_equal("", bufname(buf))
  
+   au! BufWinEnter
    unlet g:job
  endfunc
  
*** ../vim-8.0.1130/src/version.c       2017-09-20 22:42:58.454952103 +0200
--- src/version.c       2017-09-21 22:15:27.757662964 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     1131,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "[email protected]" and refer to your
     children as "forked processes."

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui