diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-15 16:49:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 16:49:00 +0800 |
commit | 564d99c89a3d9a236df758d320cc38abc50215ec (patch) | |
tree | 9798e6718ce448953e32caf604641b063f58b5fc /src/nvim/buffer.c | |
parent | 9777907467b29e890556db287b6a9995c0024896 (diff) | |
parent | a649af4dbaba5ef13dcbf610fe584dbc67cf2435 (diff) | |
download | rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.tar.gz rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.tar.bz2 rneovim-564d99c89a3d9a236df758d320cc38abc50215ec.zip |
Merge pull request #19373 from zeertzjq/vim-8.2.0426
vim-patch:8.0.1118,8.2.0426
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 69aaee4f9b..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 @@ -443,6 +451,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i return false; } + // check no autocommands closed the window if (win != NULL // Avoid bogus clang warning. && win_valid_any_tab(win)) { // Set b_last_cursor when closing the last window for the buffer. @@ -1643,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. |