summaryrefslogtreecommitdiffstats
path: root/src/buffer.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/buffer.c
parent53ed192b3c4a014c6bfe19a99623f5a2761a38d3 (diff)
updated for version 7.0-087v7.0.087
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 3359bc2409..e05bd3935e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -434,12 +434,8 @@ close_buffer(win, buf, action)
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 @@ enter_buffer(buf)
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 @@ enter_buffer(buf)
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
*/