diff options
Diffstat (limited to 'src/nvim/globals.h')
| -rw-r--r-- | src/nvim/globals.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h index baa85c01f8..9da6062ffb 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -512,9 +512,9 @@ EXTERN int keep_filetype INIT(= FALSE); /* value for did_filetype when starting to execute autocommands */ -/* When deleting the current buffer, another one must be loaded. If we know - * which one is preferred, au_new_curbuf is set to it */ -EXTERN buf_T *au_new_curbuf INIT(= NULL); +// When deleting the current buffer, another one must be loaded. +// If we know which one is preferred, au_new_curbuf is set to it. +EXTERN bufref_T au_new_curbuf INIT(= { NULL, 0 }); // When deleting a buffer/window and autocmd_busy is TRUE, do not free the // buffer/window. but link it in the list starting with @@ -602,7 +602,10 @@ EXTERN buf_T *lastbuf INIT(= NULL); // last buffer EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer // Iterates over all buffers in the buffer list. -# define FOR_ALL_BUFFERS(buf) for (buf_T *buf = firstbuf; buf != NULL; buf = buf->b_next) +#define FOR_ALL_BUFFERS(buf) \ + for (buf_T *buf = firstbuf; buf != NULL; buf = buf->b_next) +#define FOR_ALL_BUFFERS_BACKWARDS(buf) \ + for (buf_T *buf = lastbuf; buf != NULL; buf = buf->b_prev) /* Flag that is set when switching off 'swapfile'. It means that all blocks * are to be loaded into memory. Shouldn't be global... */ |