diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:40:31 +0000 |
commit | 339e2d15cc26fe86988ea06468d912a46c8d6f29 (patch) | |
tree | a6167fc8fcfc6ae2dc102f57b2473858eac34063 /src/nvim/buffer.h | |
parent | 067dc73729267c0262438a6fdd66e586f8496946 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.gz rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.tar.bz2 rneovim-339e2d15cc26fe86988ea06468d912a46c8d6f29.zip |
Merge remote-tracking branch 'upstream/master' into fix_repeatcmdline
Diffstat (limited to 'src/nvim/buffer.h')
-rw-r--r-- | src/nvim/buffer.h | 81 |
1 files changed, 38 insertions, 43 deletions
diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h index 610d9e37ec..36e70d1927 100644 --- a/src/nvim/buffer.h +++ b/src/nvim/buffer.h @@ -1,76 +1,74 @@ -#ifndef NVIM_BUFFER_H -#define NVIM_BUFFER_H +#pragma once #include <assert.h> #include <stdbool.h> #include <stddef.h> -#include "nvim/buffer_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: export #include "nvim/eval/typval.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/func_attr.h" -#include "nvim/grid_defs.h" // for StlClickRecord -#include "nvim/macros.h" +#include "nvim/macros_defs.h" #include "nvim/memline.h" #include "nvim/memline_defs.h" -#include "nvim/pos.h" +#include "nvim/pos_defs.h" -// Values for buflist_getfile() +/// Values for buflist_getfile() enum getf_values { - GETF_SETMARK = 0x01, // set pcmark before jumping - GETF_ALT = 0x02, // jumping to alternate file (not buf num) - GETF_SWITCH = 0x04, // respect 'switchbuf' settings when jumping + GETF_SETMARK = 0x01, ///< set pcmark before jumping + GETF_ALT = 0x02, ///< jumping to alternate file (not buf num) + GETF_SWITCH = 0x04, ///< respect 'switchbuf' settings when jumping }; // Return values of getfile() enum getf_retvalues { - GETFILE_ERROR = 1, // normal error - GETFILE_NOT_WRITTEN = 2, // "not written" error - GETFILE_SAME_FILE = 0, // success, same file - GETFILE_OPEN_OTHER = (-1), // success, opened another file + GETFILE_ERROR = 1, ///< normal error + GETFILE_NOT_WRITTEN = 2, ///< "not written" error + GETFILE_SAME_FILE = 0, ///< success, same file + GETFILE_OPEN_OTHER = -1, ///< success, opened another file GETFILE_UNUSED = 8, }; -// Values for buflist_new() flags +/// Values for buflist_new() flags enum bln_values { - BLN_CURBUF = 1, // May re-use curbuf for new buffer - BLN_LISTED = 2, // Put new buffer in buffer list - BLN_DUMMY = 4, // Allocating dummy buffer - BLN_NEW = 8, // create a new buffer - BLN_NOOPT = 16, // Don't copy options to existing buffer + BLN_CURBUF = 1, ///< May re-use curbuf for new buffer + BLN_LISTED = 2, ///< Put new buffer in buffer list + BLN_DUMMY = 4, ///< Allocating dummy buffer + BLN_NEW = 8, ///< create a new buffer + BLN_NOOPT = 16, ///< Don't copy options to existing buffer // BLN_DUMMY_OK = 32, // also find an existing dummy buffer // BLN_REUSE = 64, // may re-use number from buf_reuse - BLN_NOCURWIN = 128, // buffer is not associated with curwin + BLN_NOCURWIN = 128, ///< buffer is not associated with curwin }; -// Values for action argument for do_buffer() +/// Values for action argument for do_buffer() enum dobuf_action_values { - DOBUF_GOTO = 0, // go to specified buffer - DOBUF_SPLIT = 1, // split window and go to specified buffer - DOBUF_UNLOAD = 2, // unload specified buffer(s) - DOBUF_DEL = 3, // delete specified buffer(s) from buflist - DOBUF_WIPE = 4, // delete specified buffer(s) really + DOBUF_GOTO = 0, ///< go to specified buffer + DOBUF_SPLIT = 1, ///< split window and go to specified buffer + DOBUF_UNLOAD = 2, ///< unload specified buffer(s) + DOBUF_DEL = 3, ///< delete specified buffer(s) from buflist + DOBUF_WIPE = 4, ///< delete specified buffer(s) really }; -// Values for start argument for do_buffer() +/// Values for start argument for do_buffer() enum dobuf_start_values { - DOBUF_CURRENT = 0, // "count" buffer from current buffer - DOBUF_FIRST = 1, // "count" buffer from first buffer - DOBUF_LAST = 2, // "count" buffer from last buffer - DOBUF_MOD = 3, // "count" mod. buffer from current buffer + DOBUF_CURRENT = 0, ///< "count" buffer from current buffer + DOBUF_FIRST = 1, ///< "count" buffer from first buffer + DOBUF_LAST = 2, ///< "count" buffer from last buffer + DOBUF_MOD = 3, ///< "count" mod. buffer from current buffer }; -// flags for buf_freeall() +/// flags for buf_freeall() enum bfa_values { - BFA_DEL = 1, // buffer is going to be deleted - BFA_WIPE = 2, // buffer is going to be wiped out - BFA_KEEP_UNDO = 4, // do not free undo information - BFA_IGNORE_ABORT = 8, // do not abort for aborting() + BFA_DEL = 1, ///< buffer is going to be deleted + BFA_WIPE = 2, ///< buffer is going to be wiped out + BFA_KEEP_UNDO = 4, ///< do not free undo information + BFA_IGNORE_ABORT = 8, ///< do not abort for aborting() }; -EXTERN char *msg_loclist INIT(= N_("[Location List]")); -EXTERN char *msg_qflist INIT(= N_("[Quickfix List]")); +EXTERN char *msg_loclist INIT( = N_("[Location List]")); +EXTERN char *msg_qflist INIT( = N_("[Quickfix List]")); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer.h.generated.h" @@ -137,8 +135,5 @@ static inline void buf_inc_changedtick(buf_T *const buf) 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'; + return buf->b_ml.ml_line_count == 1 && *ml_get_buf(buf, 1) == '\0'; } - -#endif // NVIM_BUFFER_H |