aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-15 11:43:42 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-15 15:21:39 +0800
commita649af4dbaba5ef13dcbf610fe584dbc67cf2435 (patch)
tree9798e6718ce448953e32caf604641b063f58b5fc /src/nvim/buffer.c
parent7b5b7b3cc6306e9313dcf677f212cb132bd38aa0 (diff)
downloadrneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.tar.gz
rneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.tar.bz2
rneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.zip
vim-patch:8.2.0426: some errors were not tested for
Problem: Some errors were not tested for. Solution: Add tests. (Dominique Pelle, closes vim/vim#5824) https://github.com/vim/vim/commit/9b9be007e7d674f49fc2b650f840d08532b180ad Cherry-pick get_highest_fnum() from patch 8.1.1908 to make tests pass.
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index ee3a8c26b8..09f5ebe217 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -94,11 +94,19 @@ static char *e_buflocked = N_("E937: Attempt to delete a buffer that is in use")
// Number of times free_buffer() was called.
static int buf_free_count = 0;
+static int top_file_num = 1; ///< highest file number
+
typedef enum {
kBffClearWinInfo = 1,
kBffInitChangedtick = 2,
} BufFreeFlags;
+/// @return the highest possible buffer number
+int get_highest_fnum(void)
+{
+ return top_file_num - 1;
+}
+
/// Read data from buffer for retrying.
///
/// @param read_stdin read file from stdin, otherwise fifo
@@ -1644,8 +1652,6 @@ void no_write_message_nobang(const buf_T *const buf)
// functions for dealing with the buffer list
//
-static int top_file_num = 1; ///< highest file number
-
/// Initialize b:changedtick and changedtick_val attribute
///
/// @param[out] buf Buffer to initialize for.