mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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.
This commit is contained in:
parent
9f5842e63f
commit
b127cfd75f
@ -1649,6 +1649,7 @@ do_autochdir(void)
|
|||||||
* If (flags & BLN_CURBUF) is TRUE, may use current buffer.
|
* 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_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_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.
|
* This is the ONLY way to create a new buffer.
|
||||||
*/
|
*/
|
||||||
static int top_file_num = 1; /* highest file number */
|
static int top_file_num = 1; /* highest file number */
|
||||||
@ -1676,7 +1677,7 @@ buflist_new(
|
|||||||
if (sfname == NULL || mch_stat((char *)sfname, &st) < 0)
|
if (sfname == NULL || mch_stat((char *)sfname, &st) < 0)
|
||||||
st.st_dev = (dev_T)-1;
|
st.st_dev = (dev_T)-1;
|
||||||
#endif
|
#endif
|
||||||
if (ffname != NULL && !(flags & BLN_DUMMY) && (buf =
|
if (ffname != NULL && !(flags & (BLN_DUMMY | BLN_NEW)) && (buf =
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
buflist_findname_stat(ffname, &st)
|
buflist_findname_stat(ffname, &st)
|
||||||
#else
|
#else
|
||||||
|
@ -1079,11 +1079,15 @@ find_buffer(char_u *name, int err)
|
|||||||
buf_T *save_curbuf = curbuf;
|
buf_T *save_curbuf = curbuf;
|
||||||
|
|
||||||
if (name != NULL && *name != NUL)
|
if (name != NULL && *name != NUL)
|
||||||
|
{
|
||||||
buf = buflist_findname(name);
|
buf = buflist_findname(name);
|
||||||
|
if (buf == NULL)
|
||||||
|
buf = buflist_findname_exp(name);
|
||||||
|
}
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
{
|
{
|
||||||
buf = buflist_new(name == NULL || *name == NUL ? NULL : name,
|
buf = buflist_new(name == NULL || *name == NUL ? NULL : name,
|
||||||
NULL, (linenr_T)0, BLN_LISTED);
|
NULL, (linenr_T)0, BLN_LISTED | BLN_NEW);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
buf_copy_options(buf, BCO_ENTER);
|
buf_copy_options(buf, BCO_ENTER);
|
||||||
|
@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1858,
|
||||||
/**/
|
/**/
|
||||||
1857,
|
1857,
|
||||||
/**/
|
/**/
|
||||||
|
@ -907,9 +907,10 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
|||||||
#define GETF_SWITCH 0x04 /* respect 'switchbuf' settings when jumping */
|
#define GETF_SWITCH 0x04 /* respect 'switchbuf' settings when jumping */
|
||||||
|
|
||||||
/* Values for buflist_new() flags */
|
/* Values for buflist_new() flags */
|
||||||
#define BLN_CURBUF 1 /* May re-use curbuf for new buffer */
|
#define BLN_CURBUF 1 /* may re-use curbuf for new buffer */
|
||||||
#define BLN_LISTED 2 /* Put new buffer in buffer list */
|
#define BLN_LISTED 2 /* put new buffer in buffer list */
|
||||||
#define BLN_DUMMY 4 /* Allocating dummy buffer */
|
#define BLN_DUMMY 4 /* allocating dummy buffer */
|
||||||
|
#define BLN_NEW 8 /* create a new buffer */
|
||||||
|
|
||||||
/* Values for in_cinkeys() */
|
/* Values for in_cinkeys() */
|
||||||
#define KEY_OPEN_FORW 0x101
|
#define KEY_OPEN_FORW 0x101
|
||||||
|
Loading…
x
Reference in New Issue
Block a user