comparison src/eval.c @ 9469:38e2fc4ee4ef v7.4.2015

commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 9 23:40:45 2016 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Jul 2016 23:45:05 +0200
parents cdffa812f9d1
children d735119cc327
comparison
equal deleted inserted replaced
9468:7070daf57525 9469:38e2fc4ee4ef
810 static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv); 810 static void f_tabpagewinnr(typval_T *argvars, typval_T *rettv);
811 static void f_taglist(typval_T *argvars, typval_T *rettv); 811 static void f_taglist(typval_T *argvars, typval_T *rettv);
812 static void f_tagfiles(typval_T *argvars, typval_T *rettv); 812 static void f_tagfiles(typval_T *argvars, typval_T *rettv);
813 static void f_tempname(typval_T *argvars, typval_T *rettv); 813 static void f_tempname(typval_T *argvars, typval_T *rettv);
814 static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv); 814 static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv);
815 static void f_test_autochdir(typval_T *argvars, typval_T *rettv);
815 static void f_test_disable_char_avail(typval_T *argvars, typval_T *rettv); 816 static void f_test_disable_char_avail(typval_T *argvars, typval_T *rettv);
816 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv); 817 static void f_test_garbagecollect_now(typval_T *argvars, typval_T *rettv);
817 #ifdef FEAT_JOB_CHANNEL 818 #ifdef FEAT_JOB_CHANNEL
818 static void f_test_null_channel(typval_T *argvars, typval_T *rettv); 819 static void f_test_null_channel(typval_T *argvars, typval_T *rettv);
819 #endif 820 #endif
8830 {"tan", 1, 1, f_tan}, 8831 {"tan", 1, 1, f_tan},
8831 {"tanh", 1, 1, f_tanh}, 8832 {"tanh", 1, 1, f_tanh},
8832 #endif 8833 #endif
8833 {"tempname", 0, 0, f_tempname}, 8834 {"tempname", 0, 0, f_tempname},
8834 {"test_alloc_fail", 3, 3, f_test_alloc_fail}, 8835 {"test_alloc_fail", 3, 3, f_test_alloc_fail},
8836 {"test_autochdir", 0, 0, f_test_autochdir},
8835 {"test_disable_char_avail", 1, 1, f_test_disable_char_avail}, 8837 {"test_disable_char_avail", 1, 1, f_test_disable_char_avail},
8836 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, 8838 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now},
8837 #ifdef FEAT_JOB_CHANNEL 8839 #ifdef FEAT_JOB_CHANNEL
8838 {"test_null_channel", 0, 0, f_test_null_channel}, 8840 {"test_null_channel", 0, 0, f_test_null_channel},
8839 #endif 8841 #endif
13153 wp = find_tabwin(&argvars[0], &argvars[1]); 13155 wp = find_tabwin(&argvars[0], &argvars[1]);
13154 if (wp != NULL) 13156 if (wp != NULL)
13155 { 13157 {
13156 if (wp->w_localdir != NULL) 13158 if (wp->w_localdir != NULL)
13157 rettv->vval.v_string = vim_strsave(wp->w_localdir); 13159 rettv->vval.v_string = vim_strsave(wp->w_localdir);
13158 else if(globaldir != NULL) 13160 else if (globaldir != NULL)
13159 rettv->vval.v_string = vim_strsave(globaldir); 13161 rettv->vval.v_string = vim_strsave(globaldir);
13160 else 13162 else
13161 { 13163 {
13162 cwd = alloc(MAXPATHL); 13164 cwd = alloc(MAXPATHL);
13163 if (cwd != NULL) 13165 if (cwd != NULL)
21075 did_outofmem_msg = FALSE; 21077 did_outofmem_msg = FALSE;
21076 } 21078 }
21077 } 21079 }
21078 21080
21079 /* 21081 /*
21082 * "test_autochdir()"
21083 */
21084 static void
21085 f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
21086 {
21087 #if defined(FEAT_AUTOCHDIR)
21088 test_autochdir = TRUE;
21089 #endif
21090 }
21091
21092 /*
21080 * "test_disable_char_avail({expr})" function 21093 * "test_disable_char_avail({expr})" function
21081 */ 21094 */
21082 static void 21095 static void
21083 f_test_disable_char_avail(typval_T *argvars, typval_T *rettv UNUSED) 21096 f_test_disable_char_avail(typval_T *argvars, typval_T *rettv UNUSED)
21084 { 21097 {