mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.1.1547: functionality of bt_nofile() is confusing
Problem: Functionality of bt_nofile() is confusing. Solution: Split into bt_nofile() and bt_nofilename().
This commit is contained in:
13
src/buffer.c
13
src/buffer.c
@@ -5698,7 +5698,7 @@ bt_popup(buf_T *buf)
|
||||
* buffer. This means the buffer name is not a file name.
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
bt_nofilename(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|
||||
|| buf->b_p_bt[0] == 'a'
|
||||
@@ -5706,6 +5706,15 @@ bt_nofile(buf_T *buf)
|
||||
|| buf->b_p_bt[0] == 'p');
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" has 'buftype' set to "nofile".
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f';
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt"
|
||||
* buffer.
|
||||
@@ -5772,7 +5781,7 @@ buf_spname(buf_T *buf)
|
||||
|
||||
/* There is no _file_ when 'buftype' is "nofile", b_sfname
|
||||
* contains the name as specified by the user. */
|
||||
if (bt_nofile(buf))
|
||||
if (bt_nofilename(buf))
|
||||
{
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (buf->b_term != NULL)
|
||||
|
Reference in New Issue
Block a user