Problem: Functionality of bt_nofile() is confusing.
Solution: Split into bt_nofile() and bt_nofilename().
* 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'
|| 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.
/* 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)
if (buf->b_fname != NULL
&& (path_with_url(buf->b_fname)
#ifdef FEAT_QUICKFIX
- || bt_nofile(buf)
+ || bt_nofilename(buf)
#endif
)
&& STRCMP(buf->b_fname, avar->vval.v_string) == 0)
|| (buf->b_flags & BF_READERR))
&& !p_wa
#ifdef FEAT_QUICKFIX
- && !bt_nofile(buf)
+ && !bt_nofilename(buf)
#endif
&& vim_fexists(ffname))
{
&& wp->w_buffer->b_ffname != NULL
&& !bt_help(wp->w_buffer)
#ifdef FEAT_QUICKFIX
- && !bt_nofile(wp->w_buffer)
+ && !bt_nofilename(wp->w_buffer)
#endif
)
{
if (wp->w_buffer->b_fname == NULL
#ifdef FEAT_QUICKFIX
/* When 'buftype' is "nofile" can't restore the window contents. */
- || bt_nofile(wp->w_buffer)
+ || bt_nofilename(wp->w_buffer)
#endif
)
return (ssop_flags & SSOP_BLANK);
*/
if (wp->w_buffer->b_ffname != NULL
# ifdef FEAT_QUICKFIX
- && !bt_nofile(wp->w_buffer)
+ && !bt_nofilename(wp->w_buffer)
# endif
)
{
&& whole
&& buf == curbuf
#ifdef FEAT_QUICKFIX
- && !bt_nofile(buf)
+ && !bt_nofilename(buf)
#endif
&& !filtering
&& (!append || vim_strchr(p_cpo, CPO_FNAMEAPP) != NULL)
sfname, sfname, FALSE, curbuf, eap)))
{
#ifdef FEAT_QUICKFIX
- if (overwriting && bt_nofile(curbuf))
+ if (overwriting && bt_nofilename(curbuf))
nofile_err = TRUE;
else
#endif
else
{
#ifdef FEAT_QUICKFIX
- if (overwriting && bt_nofile(curbuf))
+ if (overwriting && bt_nofilename(curbuf))
nofile_err = TRUE;
else
#endif
sfname, sfname, FALSE, curbuf, eap)))
{
#ifdef FEAT_QUICKFIX
- if (overwriting && bt_nofile(curbuf))
+ if (overwriting && bt_nofilename(curbuf))
nofile_err = TRUE;
else
#endif
if (buf->b_fname != NULL
#ifdef FEAT_QUICKFIX
- && !bt_nofile(buf)
+ && !bt_nofilename(buf)
#endif
&& !path_with_url(buf->b_fname)
&& (force
if (!resized
&& curbuf->b_nwindows == 1
&& curbuf->b_fname == NULL
- && curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f'
+ && bt_nofile(curbuf)
&& curbuf->b_p_bh[0] == 'w')
{
/* Already a "wipeout" buffer, make it empty. */
int bt_help(buf_T *buf);
int bt_prompt(buf_T *buf);
int bt_popup(buf_T *buf);
+int bt_nofilename(buf_T *buf);
int bt_nofile(buf_T *buf);
int bt_dontwrite(buf_T *buf);
int bt_dontwrite_msg(buf_T *buf);
// Set the options for the quickfix buffer/window (if not already done)
// Do this even if the quickfix buffer was already present, as an autocmd
// might have previously deleted (:bdelete) the quickfix buffer.
- if (curbuf->b_p_bt[0] != 'q')
+ if (bt_quickfix(curbuf))
qf_set_cwindow_options();
// Only set the height when still in the same tab page and there is no
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1547,
/**/
1546,
/**/