mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 10:01:49 +00:00
Merge pull request #17363 from zeertzjq/dirchangedpre
feat(events): add DirChangedPre
This commit is contained in:
@@ -525,8 +525,19 @@ DirChanged After the |current-directory| was changed.
|
||||
"global" to trigger on `:cd`
|
||||
"auto" to trigger on 'autochdir'.
|
||||
Sets these |v:event| keys:
|
||||
cwd: current working directory
|
||||
scope: "global", "tabpage", "window"
|
||||
cwd: current working directory
|
||||
scope: "global", "tabpage", "window"
|
||||
changed_window: v:true if we fired the event
|
||||
switching window (or tab)
|
||||
<afile> is set to the new directory name.
|
||||
Non-recursive (event cannot trigger itself).
|
||||
*DirChangedPre*
|
||||
DirChangedPre When the |current-directory| is going to be
|
||||
changed, as with |DirChanged|.
|
||||
The pattern is like with |DirChanged|.
|
||||
Sets these |v:event| keys:
|
||||
directory: new working directory
|
||||
scope: "global", "tabpage", "window"
|
||||
changed_window: v:true if we fired the event
|
||||
switching window (or tab)
|
||||
<afile> is set to the new directory name.
|
||||
|
||||
@@ -433,7 +433,8 @@ Vimscript compatibility:
|
||||
`this_session` does not alias to |v:this_session|
|
||||
|
||||
Working directory (Vim implemented some of these later than Nvim):
|
||||
- |DirChanged| can be triggered when switching to another window.
|
||||
- |DirChanged| and |DirChangedPre| can be triggered when switching to another
|
||||
window or tab.
|
||||
- |getcwd()| and |haslocaldir()| may throw errors if the tab page or window
|
||||
cannot be found. *E5000* *E5001* *E5002*
|
||||
- |haslocaldir()| checks for tab-local directory if and only if -1 is passed as
|
||||
|
||||
Reference in New Issue
Block a user