0
0
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:
Bram Moolenaar
2019-06-15 19:37:15 +02:00
parent 0331faf712
commit 26910de8b0
9 changed files with 26 additions and 14 deletions

View File

@@ -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)