robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. Keyesfeat(cwd)!: :lcd! (bang), rearrange :bcd/:lcd/… scope precedence #41194a4a544032a

master
1.5 KiB56 linesraw
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
8enum {
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.
16typedef 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().
26typedef enum {
27  kUnknown,
28  kWorking,
29  kBroken,
30} WorkingStatus;
31
32/// The scope of a working-directory command like `:cd`. Enumerated from lowest to highest.
33typedef enum {
34  kCdScopeInvalid = -1,
35  kCdScopeBuffer,   ///< Affects one buffer.
36  kCdScopeWindow,   ///< Affects one window.
37  kCdScopeTabpage,  ///< Affects one tab page.
38  kCdScopeGlobal,   ///< Affects the entire Nvim instance.
39} CdScope;
40
41/// What caused the current directory to change.
42typedef enum {
43  kCdCauseOther = -1,
44  kCdCauseManual,  ///< Using `:cd`, `:tcd`, `:lcd`, `:bcd` or `chdir()`.
45  kCdCauseWindow,  ///< Switching to another window.
46  kCdCauseBuffer,  ///< Switching to another buffer.
47  kCdCauseAuto,    ///< On 'autochdir'.
48} CdCause;
49
50// return values for functions
51#if !(defined(OK) && (OK == 1))
52// OK already defined to 1 in MacOS X curses, skip this
53# define OK                     1
54#endif
55#define FAIL                    0
56#define NOTDONE                 2   // not OK or FAIL but skipped