diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-09 23:40:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-09 23:40:45 +0200 |
commit | 5c71994f4ee5f87d4cce990dbc9684c70b1e108b (patch) | |
tree | 54d709f577451315f508421842acd40c5d8776f1 /src/eval.c | |
parent | 32b808a4bdf35b0dea63c735702a591e5869fecd (diff) | |
download | vim-5c71994f4ee5f87d4cce990dbc9684c70b1e108b.zip |
patch 7.4.2015
Problem: When a file gets a name when writing it 'acd' is not effective.
(Dan Church)
Solution: Invoke DO_AUTOCHDIR after writing the file. (Allen Haim, closes
#777, closes #803) Add test_autochdir() to enable 'acd' before
"starting" is reset.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 6e15a55df..8b6760447 100644 --- a/src/eval.c +++ b/src/eval.c @@ -812,6 +812,7 @@ static void f_taglist(typval_T *argvars, typval_T *rettv); static void f_tagfiles(typval_T *argvars, typval_T *rettv); static void f_tempname(typval_T *argvars, typval_T *rettv); static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv); +static void f_test_autochdir(typval_T *argvars, typval_T *rettv); static void f_test_disable_char_avail(typval_T *argvars, typval_T *rettv); static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv); #ifdef FEAT_JOB_CHANNEL @@ -8832,6 +8833,7 @@ static struct fst #endif {"tempname", 0, 0, f_tempname}, {"test_alloc_fail", 3, 3, f_test_alloc_fail}, + {"test_autochdir", 0, 0, f_test_autochdir}, {"test_disable_char_avail", 1, 1, f_test_disable_char_avail}, {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, #ifdef FEAT_JOB_CHANNEL @@ -13155,7 +13157,7 @@ f_getcwd(typval_T *argvars, typval_T *rettv) { if (wp->w_localdir != NULL) rettv->vval.v_string = vim_strsave(wp->w_localdir); - else if(globaldir != NULL) + else if (globaldir != NULL) rettv->vval.v_string = vim_strsave(globaldir); else { @@ -21077,6 +21079,17 @@ f_test_alloc_fail(typval_T *argvars, typval_T *rettv UNUSED) } /* + * "test_autochdir()" + */ + static void +f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ +#if defined(FEAT_AUTOCHDIR) + test_autochdir = TRUE; +#endif +} + +/* * "test_disable_char_avail({expr})" function */ static void |