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

@@ -1515,6 +1515,13 @@ vim.bo.ci = vim.bo.copyindent
--- character, the cursor won't move. When not included,
--- the cursor would skip over it and jump to the
--- following occurrence.
--- *cpo-~*
--- ~ When included, don't resolve symbolic links when
--- changing directory with `:cd`, `:lcd`, or `:tcd`.
--- This preserves the symbolic link path in buffer names
--- and when displaying the current directory. When
--- excluded (default), symbolic links are resolved to
--- their target paths.
--- *cpo-_*
--- _ When using `cw` on a word, do not include the
--- whitespace following the word in the motion.