Patch 7.4.1858
Problem:    When a channel writes to a buffer it doesn't find a buffer by the
            short name but re-uses it anyway.
Solution:   Find buffer also by the short name.
Files:      src/channel.c, src/buffer.c, src/vim.h


*** ../vim-7.4.1857/src/channel.c       2016-05-29 16:16:39.381326993 +0200
--- src/channel.c       2016-05-29 16:18:11.985325720 +0200
***************
*** 1079,1089 ****
      buf_T *save_curbuf = curbuf;
  
      if (name != NULL && *name != NUL)
        buf = buflist_findname(name);
      if (buf == NULL)
      {
        buf = buflist_new(name == NULL || *name == NUL ? NULL : name,
!                                              NULL, (linenr_T)0, BLN_LISTED);
        if (buf == NULL)
            return NULL;
        buf_copy_options(buf, BCO_ENTER);
--- 1079,1093 ----
      buf_T *save_curbuf = curbuf;
  
      if (name != NULL && *name != NUL)
+     {
        buf = buflist_findname(name);
+       if (buf == NULL)
+           buf = buflist_findname_exp(name);
+     }
      if (buf == NULL)
      {
        buf = buflist_new(name == NULL || *name == NUL ? NULL : name,
!                                    NULL, (linenr_T)0, BLN_LISTED | BLN_NEW);
        if (buf == NULL)
            return NULL;
        buf_copy_options(buf, BCO_ENTER);
*** ../vim-7.4.1857/src/buffer.c        2016-05-24 16:07:35.031276986 +0200
--- src/buffer.c        2016-05-29 15:18:05.789375326 +0200
***************
*** 1649,1654 ****
--- 1649,1655 ----
   * If (flags & BLN_CURBUF) is TRUE, may use current buffer.
   * If (flags & BLN_LISTED) is TRUE, add new buffer to buffer list.
   * If (flags & BLN_DUMMY) is TRUE, don't count it as a real buffer.
+  * If (flags & BLN_NEW) is TRUE, don't use an existing buffer.
   * This is the ONLY way to create a new buffer.
   */
  static int  top_file_num = 1;         /* highest file number */
***************
*** 1676,1682 ****
      if (sfname == NULL || mch_stat((char *)sfname, &st) < 0)
        st.st_dev = (dev_T)-1;
  #endif
!     if (ffname != NULL && !(flags & BLN_DUMMY) && (buf =
  #ifdef UNIX
                buflist_findname_stat(ffname, &st)
  #else
--- 1677,1683 ----
      if (sfname == NULL || mch_stat((char *)sfname, &st) < 0)
        st.st_dev = (dev_T)-1;
  #endif
!     if (ffname != NULL && !(flags & (BLN_DUMMY | BLN_NEW)) && (buf =
  #ifdef UNIX
                buflist_findname_stat(ffname, &st)
  #else
*** ../vim-7.4.1857/src/vim.h   2016-05-01 13:09:53.866174520 +0200
--- src/vim.h   2016-05-29 15:18:58.641374599 +0200
***************
*** 907,915 ****
  #define GETF_SWITCH   0x04    /* respect 'switchbuf' settings when jumping */
  
  /* Values for buflist_new() flags */
! #define BLN_CURBUF    1       /* May re-use curbuf for new buffer */
! #define BLN_LISTED    2       /* Put new buffer in buffer list */
! #define BLN_DUMMY     4       /* Allocating dummy buffer */
  
  /* Values for in_cinkeys() */
  #define KEY_OPEN_FORW 0x101
--- 907,916 ----
  #define GETF_SWITCH   0x04    /* respect 'switchbuf' settings when jumping */
  
  /* Values for buflist_new() flags */
! #define BLN_CURBUF    1       /* may re-use curbuf for new buffer */
! #define BLN_LISTED    2       /* put new buffer in buffer list */
! #define BLN_DUMMY     4       /* allocating dummy buffer */
! #define BLN_NEW               8       /* create a new buffer */
  
  /* Values for in_cinkeys() */
  #define KEY_OPEN_FORW 0x101
*** ../vim-7.4.1857/src/version.c       2016-05-29 16:16:39.381326993 +0200
--- src/version.c       2016-05-29 16:22:42.437321999 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1858,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
8. Don't use any punctuation marks.

 /// 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