robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
38986188ba
master
1#pragma once 2 3#include <stdint.h> 4 5#include "nvim/buffer_defs.h" // IWYU pragma: keep 6#include "nvim/eval/typval_defs.h" 7#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep 8#include "nvim/gettext_defs.h" // IWYU pragma: keep 9#include "nvim/macros_defs.h" 10#include "nvim/marktree_defs.h" 11#include "nvim/types_defs.h" 12 13/// Values for buflist_getfile() 14enum getf_values { 15GETF_SETMARK = 0x01 ,///< set pcmark before jumping 16GETF_ALT = 0x02 ,///< jumping to alternate file (not buf num) 17GETF_SWITCH = 0x04 ,///< respect 'switchbuf' settings when jumping 18}; 19 20// Return values of getfile() 21enum getf_retvalues { 22GETFILE_ERROR = 1 ,///< normal error 23GETFILE_NOT_WRITTEN = 2 ,///< "not written" error 24GETFILE_SAME_FILE = 0 ,///< success, same file 25GETFILE_OPEN_OTHER = -1 ,///< success, opened another file 26GETFILE_UNUSED = 8 , 27}; 28 29/// Values for buflist_new() flags 30enum bln_values { 31BLN_CURBUF = 1 ,///< May re-use curbuf for new buffer 32BLN_LISTED = 2 ,///< Put new buffer in buffer list 33BLN_DUMMY = 4 ,///< Allocating dummy buffer 34BLN_NEW = 8 ,///< create a new buffer 35BLN_NOOPT = 16 ,///< Don't copy options to existing buffer 36// BLN_DUMMY_OK = 32, // also find an existing dummy buffer 37// BLN_REUSE = 64, // may re-use number from buf_reuse 38BLN_NOCURWIN = 128 ,///< buffer is not associated with curwin 39}; 40 41/// Values for action argument for do_buffer_ext() and close_buffer() 42enum dobuf_action_values { 43DOBUF_GOTO = 0 ,///< go to specified buffer 44DOBUF_SPLIT = 1 ,///< split window and go to specified buffer 45DOBUF_UNLOAD = 2 ,///< unload specified buffer(s) 46DOBUF_DEL = 3 ,///< delete specified buffer(s) from buflist 47DOBUF_WIPE = 4 ,///< delete specified buffer(s) really 48}; 49 50/// Values for start argument for do_buffer_ext() 51enum dobuf_start_values { 52DOBUF_CURRENT = 0 ,///< "count" buffer from current buffer 53DOBUF_FIRST = 1 ,///< "count" buffer from first buffer 54DOBUF_LAST = 2 ,///< "count" buffer from last buffer 55DOBUF_MOD = 3 ,///< "count" mod. buffer from current buffer 56}; 57 58/// Values for flags argument of do_buffer_ext() 59enum dobuf_flags_value { 60DOBUF_FORCEIT = 1 ,///< :cmd! 61DOBUF_SKIPHELP = 4 ,///< skip or keep help buffers depending on b_help of the 62///< starting buffer 63}; 64 65/// flags for buf_freeall() 66enum bfa_values { 67BFA_DEL = 1 ,///< buffer is going to be deleted 68BFA_WIPE = 2 ,///< buffer is going to be wiped out 69BFA_KEEP_UNDO = 4 ,///< do not free undo information 70BFA_IGNORE_ABORT = 8 ,///< do not abort for aborting() 71}; 72 73EXTERN char * msg_loclist INIT (= N_ ("[Location List]" )); 74EXTERN char * msg_qflist INIT (= N_ ("[Quickfix List]" )); 75 76#include "buffer.h.generated.h" 77#include "buffer.h.inline.generated.h" 78 79/// Get b:changedtick value 80/// 81/// Faster then querying b:. 82/// 83/// @param[in] buf Buffer to get b:changedtick from. 84static inline varnumber_T buf_get_changedtick (const buf_T * const buf ) 85FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_PURE 86FUNC_ATTR_WARN_UNUSED_RESULT 87{ 88return buf -> changedtick_di .di_tv .vval .v_number ; 89} 90 91static inline uint32_t buf_meta_total (const buf_T * b ,MetaIndex m ) 92{ 93return b -> b_marktree -> meta_root [m ]; 94}