summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-09-05 14:31:54 +0000
committerBram Moolenaar <Bram@vim.org>2006-09-05 14:31:54 +0000
commit498efdb7f652d45d6dda68da3e8b12a541ff4494 (patch)
treeb95e01c4476886bacd9ed75b7a8f8dd817c1a1ce /src/ex_cmds.c
parent53ed192b3c4a014c6bfe19a99623f5a2761a38d3 (diff)
downloadvim-git-498efdb7f652d45d6dda68da3e8b12a541ff4494.tar.gz
updated for version 7.0-087v7.0.087
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 70440735c..074abfdfb 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2458,6 +2458,8 @@ ex_file(eap)
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
#endif
+ /* Change directories when the 'acd' option is set. */
+ DO_AUTOCHDIR
}
/* print full file name if :cd used */
fileinfo(FALSE, FALSE, eap->forceit);
@@ -2675,8 +2677,13 @@ do_write(eap)
eap, eap->append, eap->forceit, TRUE, FALSE);
/* After ":saveas fname" reset 'readonly'. */
- if (eap->cmdidx == CMD_saveas && retval == OK)
- curbuf->b_p_ro = FALSE;
+ if (eap->cmdidx == CMD_saveas)
+ {
+ if (retval == OK)
+ curbuf->b_p_ro = FALSE;
+ /* Change directories when the 'acd' option is set. */
+ DO_AUTOCHDIR
+ }
}
theend:
@@ -3547,11 +3554,9 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
foldUpdateAll(curwin);
#endif
-#ifdef FEAT_AUTOCHDIR
- if (p_acd && curbuf->b_ffname != NULL
- && vim_chdirfile(curbuf->b_ffname) == OK)
- shorten_fnames(TRUE);
-#endif
+ /* Change directories when the 'acd' option is set. */
+ DO_AUTOCHDIR
+
/*
* Careful: open_buffer() and apply_autocmds() may change the current
* buffer and window.
@@ -3718,12 +3723,8 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
if (p_im)
need_start_insertmode = TRUE;
-#ifdef FEAT_AUTOCHDIR
- /* Change directories when the acd option is set on. */
- if (p_acd && curbuf->b_ffname != NULL
- && vim_chdirfile(curbuf->b_ffname) == OK)
- shorten_fnames(TRUE);
-#endif
+ /* Change directories when the 'acd' option is set. */
+ DO_AUTOCHDIR
#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
if (gui.in_use && curbuf->b_ffname != NULL)