Implement tab-local working directory feature.

New ex commands: 'tcd', 'tchdir'
Changed Vimscript functions: 'haslocaldir', 'getcwd'

The ex-commands ':tcd' and ':tchdir' are the tab-local equivalents of
':lcd' and ':lchdir'. There are no new Vimscript functions introduced,
instead the functions 'haslocaldir' and 'getcwd' take in optional
arguments. See the documentation for details

Since there is now different levels of local directory a simple boolean
at source level is no longer sufficient; a new enumeration type is used
for the scope-level from now on.

The documentation has been accommodated for these new commands and
functional tests have been written to test the feature.
This commit is contained in:
HiPhish
2015-08-24 12:58:28 +02:00
parent a7a0bf54e3
commit ec71d87b81
10 changed files with 557 additions and 78 deletions

View File

@@ -19,6 +19,18 @@
#define EXMODE_NORMAL 1
#define EXMODE_VIM 2
/// The scope of a command.
///
/// The lower a number, the deeper the scope.
typedef enum {
kCdScopeWindow, ///< Affects one window.
kCdScopeTab, ///< Affects one tab page.
kCdScopeGlobal, ///< Affects the entire instance of NeoVim.
} CdScope;
/// Last `:cd` scope defined.
#define MAX_CD_SCOPE kCdScopeGlobal
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ex_docmd.h.generated.h"
#endif