patch 8.0.1459: cannot handle change of directory
Problem: Cannot handle change of directory.
Solution: Add the DirChanged autocommand event. (Andy Massimino,
closes #888) Avoid changing directory for 'autochdir' too often.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 4adf007..350ae7e 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -295,6 +295,8 @@
|FileChangedShellPost| After handling a file changed since editing started
|FileChangedRO| before making the first change to a read-only file
+|DirChanged| after the working directory has changed
+
|ShellCmdPost| after executing a shell command
|ShellFilterPost| after filtering with a shell command
@@ -633,6 +635,16 @@
*E881*
If the number of lines changes saving for undo
may fail and the change will be aborted.
+ *DirChanged*
+DirChanged The working directory has changed in response
+ to the |:cd| or |:lcd| commands, or as a
+ result of the 'autochdir' option.
+ The pattern can be:
+ "window" to trigger on `:lcd
+ "global" to trigger on `:cd`
+ "auto" to trigger on 'autochdir'.
+ "drop" to trigger on editing a file
+ <afile> is set to the new directory name.
*FileChangedShell*
FileChangedShell When Vim notices that the modification time of
a file has changed since editing started.