updated for version 7.0-087
diff --git a/src/buffer.c b/src/buffer.c
index 3359bc2..e05bd39 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -434,12 +434,8 @@
if (usingNetbeans)
netbeans_file_closed(buf);
#endif
-#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
/*
* Remove the buffer from the list.
@@ -1422,12 +1418,8 @@
netbeans_file_activated(curbuf);
#endif
-#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
#ifdef FEAT_KEYMAP
if (curbuf->b_kmap_state & KEYMAP_INIT)
@@ -1436,6 +1428,18 @@
redraw_later(NOT_VALID);
}
+#if defined(FEAT_AUTOCHDIR) || defined(PROTO)
+/*
+ * Change to the directory of the current buffer.
+ */
+ void
+do_autochdir()
+{
+ if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+}
+#endif
+
/*
* functions for dealing with the buffer list
*/