mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 11:18:19 +00:00
buffer: move BUFEMPTY to a function
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "nvim/func_attr.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/macros.h"
|
||||
#include "nvim/memline.h"
|
||||
|
||||
// Values for buflist_getfile()
|
||||
enum getf_values {
|
||||
@@ -128,4 +129,10 @@ static inline void buf_inc_changedtick(buf_T *const buf)
|
||||
buf_set_changedtick(buf, buf_get_changedtick(buf) + 1);
|
||||
}
|
||||
|
||||
static inline bool buf_is_empty(buf_T *buf)
|
||||
{
|
||||
return buf->b_ml.ml_line_count == 1
|
||||
&& *ml_get_buf(buf, (linenr_T)1, false) == '\0';
|
||||
}
|
||||
|
||||
#endif // NVIM_BUFFER_H
|
||||
|
Reference in New Issue
Block a user