vim-patch:9.1.1507: symlinks are resolved on :cd commands (#34758)

Problem:  File paths change from symlink to target path after :cd command
          when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
          When not included (default), symlinks are resolved maintaining
          backward compatibility. When included, symlinks are preserved
          providing the improved behavior. (glepnir)

related: neovim/neovim#15695
closes: vim/vim#17628

4ade668fb6
This commit is contained in:
glepnir
2025-07-04 13:44:39 +08:00
committed by GitHub
parent c48dea20f5
commit bb75610d99
7 changed files with 90 additions and 5 deletions

View File

@@ -6016,7 +6016,7 @@ static void post_chdir(CdScope scope, bool trigger_dirchanged)
}
last_chdir_reason = NULL;
shorten_fnames(true);
shorten_fnames(vim_strchr(p_cpo, CPO_NOSYMLINKS) == NULL);
if (trigger_dirchanged) {
do_autocmd_dirchanged(cwd, scope, kCdCauseManual, false);