diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /src/nvim/vim_defs.h | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'src/nvim/vim_defs.h')
-rw-r--r-- | src/nvim/vim_defs.h | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/src/nvim/vim_defs.h b/src/nvim/vim_defs.h index faf79b1c79..f6b348e009 100644 --- a/src/nvim/vim_defs.h +++ b/src/nvim/vim_defs.h @@ -6,20 +6,10 @@ #define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" #define RUNTIME_DIRNAME "runtime" -#include "auto/config.h" - -// Check if configure correctly managed to find sizeof(int). If this failed, -// it becomes zero. This is likely a problem of not being able to run the -// test program. Other items from configure may also be wrong then! -#if (SIZEOF_INT == 0) -# error Configure did not run properly. -#endif - -// bring lots of system header files -#include "nvim/os/os_defs.h" // IWYU pragma: keep - -/// length of a buffer to store a number in ASCII (64 bits binary + NUL) -enum { NUMBUFLEN = 65, }; +enum { + /// length of a buffer to store a number in ASCII (64 bits binary + NUL) + NUMBUFLEN = 65, +}; #define MAX_TYPENR 65535 @@ -32,6 +22,38 @@ typedef enum { BACKWARD_FILE = -3, } Direction; +/// Used to track the status of external functions. +/// Currently only used for iconv(). +typedef enum { + kUnknown, + kWorking, + kBroken, +} WorkingStatus; + +/// The scope of a working-directory command like `:cd`. +/// +/// Scopes are enumerated from lowest to highest. When adding a scope make sure +/// to update all functions using scopes as well, such as the implementation of +/// `getcwd()`. When using scopes as limits (e.g. in loops) don't use the scopes +/// directly, use `MIN_CD_SCOPE` and `MAX_CD_SCOPE` instead. +typedef enum { + kCdScopeInvalid = -1, + kCdScopeWindow, ///< Affects one window. + kCdScopeTabpage, ///< Affects one tab page. + kCdScopeGlobal, ///< Affects the entire Nvim instance. +} CdScope; + +#define MIN_CD_SCOPE kCdScopeWindow +#define MAX_CD_SCOPE kCdScopeGlobal + +/// What caused the current directory to change. +typedef enum { + kCdCauseOther = -1, + kCdCauseManual, ///< Using `:cd`, `:tcd`, `:lcd` or `chdir()`. + kCdCauseWindow, ///< Switching to another window. + kCdCauseAuto, ///< On 'autochdir'. +} CdCause; + // return values for functions #if !(defined(OK) && (OK == 1)) // OK already defined to 1 in MacOS X curses, skip this |