mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
vim-patch:8.1.0602: DirChanged is also triggered when directory didn't change
Problem: DirChanged is also triggered when the directory didn't change.
(Daniel Hahler)
Solution: Compare the current with the new directory. (closes vim/vim#3697)
2caad3fbbd
This commit is contained in:
@@ -7811,10 +7811,11 @@ void ex_cd(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
|
||||
if (vim_chdir(new_dir)) {
|
||||
bool dir_differs = prev_dir == NULL || STRCMP(prev_dir, new_dir) != 0;
|
||||
if (dir_differs && vim_chdir(new_dir)) {
|
||||
EMSG(_(e_failed));
|
||||
} else {
|
||||
post_chdir(scope, true);
|
||||
post_chdir(scope, dir_differs);
|
||||
// Echo the new current directory if the command was typed.
|
||||
if (KeyTyped || p_verbose >= 5) {
|
||||
ex_pwd(eap);
|
||||
|
Reference in New Issue
Block a user