aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-08 06:25:22 +0800
committerGitHub <noreply@github.com>2024-04-08 06:25:22 +0800
commitd188b929d46d74ca6a93e15c39cf06896a53fbf7 (patch)
tree66c0fb1f7576877c648b16cf0f7e98c734da44f7 /src/nvim/window.c
parentd32cbef59551a1808caea2ddaeac323fdc18d6b6 (diff)
downloadrneovim-d188b929d46d74ca6a93e15c39cf06896a53fbf7.tar.gz
rneovim-d188b929d46d74ca6a93e15c39cf06896a53fbf7.tar.bz2
rneovim-d188b929d46d74ca6a93e15c39cf06896a53fbf7.zip
vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223)
Problem: Autocommand may change currect directory after :tcd and :lcd. Solution: Also clear tp_localdir and w_localdir when using aucmd_win. (zeertzjq) closes: vim/vim#14435 https://github.com/vim/vim/commit/9d956ee8eab64a0d412b045305fde5bc03d95d4a
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 6d85e088b5..7389b1fe2f 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4936,7 +4936,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
win_fix_cursor(get_real_state() & (MODE_NORMAL|MODE_CMDLINE|MODE_TERMINAL));
}
- fix_current_dir();
+ win_fix_current_dir();
entering_window(curwin);
// Careful: autocommands may close the window and make "wp" invalid
@@ -4989,7 +4989,7 @@ static void win_enter_ext(win_T *const wp, const int flags)
}
/// Used after making another window the current one: change directory if needed.
-void fix_current_dir(void)
+void win_fix_current_dir(void)
{
// New directory is either the local directory of the window, tab or NULL.
char *new_dir = curwin->w_localdir ? curwin->w_localdir : curtab->tp_localdir;