vim_defs.h (1767B)
1 #pragma once 2 3 // Some defines from the old feature.h 4 #define SESSION_FILE "Session.vim" 5 #define SYS_OPTWIN_FILE "$VIMRUNTIME/scripts/optwin.lua" 6 #define RUNTIME_DIRNAME "runtime" 7 8 enum { 9 /// length of a buffer to store a number in ASCII (64 bits binary + NUL) 10 NUMBUFLEN = 65, 11 }; 12 13 #define MAX_TYPENR 65535 14 15 /// Directions. 16 typedef enum { 17 kDirectionNotSet = 0, 18 FORWARD = 1, 19 BACKWARD = -1, 20 FORWARD_FILE = 3, 21 BACKWARD_FILE = -3, 22 } Direction; 23 24 /// Used to track the status of external functions. 25 /// Currently only used for iconv(). 26 typedef enum { 27 kUnknown, 28 kWorking, 29 kBroken, 30 } WorkingStatus; 31 32 /// The scope of a working-directory command like `:cd`. 33 /// 34 /// Scopes are enumerated from lowest to highest. When adding a scope make sure 35 /// to update all functions using scopes as well, such as the implementation of 36 /// `getcwd()`. When using scopes as limits (e.g. in loops) don't use the scopes 37 /// directly, use `MIN_CD_SCOPE` and `MAX_CD_SCOPE` instead. 38 typedef enum { 39 kCdScopeInvalid = -1, 40 kCdScopeWindow, ///< Affects one window. 41 kCdScopeTabpage, ///< Affects one tab page. 42 kCdScopeGlobal, ///< Affects the entire Nvim instance. 43 } CdScope; 44 45 #define MIN_CD_SCOPE kCdScopeWindow 46 #define MAX_CD_SCOPE kCdScopeGlobal 47 48 /// What caused the current directory to change. 49 typedef enum { 50 kCdCauseOther = -1, 51 kCdCauseManual, ///< Using `:cd`, `:tcd`, `:lcd` or `chdir()`. 52 kCdCauseWindow, ///< Switching to another window. 53 kCdCauseAuto, ///< On 'autochdir'. 54 } CdCause; 55 56 // return values for functions 57 #if !(defined(OK) && (OK == 1)) 58 // OK already defined to 1 in MacOS X curses, skip this 59 # define OK 1 60 #endif 61 #define FAIL 0 62 #define NOTDONE 2 // not OK or FAIL but skipped