summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-03 17:36:27 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-03 17:36:27 +0100
commitb7407d3fc9496f9048fb65ab17b5ba3444965c0e (patch)
treeea713a63c3771ff35b52aadef755102b55cc377d /src/buffer.c
parentddb349369d107c14fad9c38baf2f0e2b8514fbf0 (diff)
patch 8.0.1459: cannot handle change of directoryv8.0.1459
Problem: Cannot handle change of directory. Solution: Add the DirChanged autocommand event. (Andy Massimino, closes #888) Avoid changing directory for 'autochdir' too often.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ecd8f4eb65..c0d3d3d9fc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -595,7 +595,7 @@ aucmd_abort:
#ifdef FEAT_DIFF
if (diffopt_hiddenoff() && !unload_buf && buf->b_nwindows == 0)
- diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */
+ diff_buf_delete(buf); /* Clear 'diff' for hidden buffer. */
#endif
/* Return when a window is displaying the buffer or when it's not
@@ -657,9 +657,6 @@ aucmd_abort:
--buf->b_nwindows;
#endif
- /* Change directories when the 'acd' option is set. */
- DO_AUTOCHDIR
-
/*
* Remove the buffer from the list.
*/
@@ -1862,7 +1859,7 @@ do_autochdir(void)
{
if ((starting == 0 || test_autochdir)
&& curbuf->b_ffname != NULL
- && vim_chdirfile(curbuf->b_ffname) == OK)
+ && vim_chdirfile(curbuf->b_ffname, "auto") == OK)
shorten_fnames(TRUE);
}
#endif