Mercurial > vim
diff src/buffer.c @ 17095:10e0d7d96cb0 v8.1.1547
patch 8.1.1547: functionality of bt_nofile() is confusing
commit https://github.com/vim/vim/commit/26910de8b0da6abab87bd5a397330f9cbe483309
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 15 19:37:15 2019 +0200
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().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Jun 2019 19:45:06 +0200 |
parents | d5e1e09a829f |
children | ebe9aab81898 |
line wrap: on
line diff
--- a/src/buffer.c +++ b/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' @@ -5707,6 +5707,15 @@ bt_nofile(buf_T *buf) } /* + * 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)