aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/globals.h')
-rw-r--r--src/nvim/globals.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 463f4fcd8d..e3c84cb852 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -1249,4 +1249,20 @@ typedef enum {
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.
+ kCdScopeTab, ///< Affects one tab page.
+ kCdScopeGlobal, ///< Affects the entire instance of Neovim.
+} CdScope;
+
+#define MIN_CD_SCOPE kCdScopeWindow
+#define MAX_CD_SCOPE kCdScopeGlobal
+
#endif /* NVIM_GLOBALS_H */