diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-15 19:37:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-15 19:37:15 +0200 |
commit | 26910de8b0da6abab87bd5a397330f9cbe483309 (patch) | |
tree | 5a76a713818d0973f6774edabc17b8c13fb924fb /src/buffer.c | |
parent | 0331faf71200a274377e1569fcda4f00c9cf3e2a (diff) | |
download | vim-git-26910de8b0da6abab87bd5a397330f9cbe483309.tar.gz |
patch 8.1.1547: functionality of bt_nofile() is confusingv8.1.1547
Problem: Functionality of bt_nofile() is confusing.
Solution: Split into bt_nofile() and bt_nofilename().
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index e6ae09d25..c3911ae2b 100644 --- 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) |