mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
vim-patch:8.1.1611: bufadd() reuses existing buffer without a name
Problem: Bufadd() reuses existing buffer without a name.
Solution: When the name is empty always create a new buffer.
892ae723ab
This commit is contained in:
@@ -7292,7 +7292,9 @@ static buf_T *find_buffer(typval_T *avar)
|
||||
// "bufadd(expr)" function
|
||||
static void f_bufadd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
rettv->vval.v_number = buflist_add(tv_get_string(&argvars[0]), 0);
|
||||
char_u *name = tv_get_string(&argvars[0]);
|
||||
|
||||
rettv->vval.v_number = buflist_add(*name == NUL ? NULL : name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user