From 655085204e36cdf91750db5e09ae3feb4884c670 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 29 Sep 2019 09:29:16 -0400 Subject: vim-patch:8.1.0230: directly checking 'buftype' value Problem: Directly checking 'buftype' value. Solution: Add the bt_normal() function. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/91335e5a67aaa9937e65f1e779b9f3f10fd33ee4 --- src/nvim/buffer.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index b50c764ac3..e5b80693a4 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5179,6 +5179,13 @@ bool bt_help(const buf_T *const buf) return buf != NULL && buf->b_help; } +// Return true if "buf" is a normal buffer, 'buftype' is empty. +bool bt_normal(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT +{ + return buf != NULL && buf->b_p_bt[0] == NUL; +} + // Return true if "buf" is the quickfix buffer. bool bt_quickfix(const buf_T *const buf) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT -- cgit