runtime(netrw): directory symlink not resolved in tree view
Commit:
https://github.com/vim/vim/commit/5b63b236a0af198f6c3c9883a3f6344b110dabb3
Author: Christian Brabandt <[email protected]>
Date: Sun Nov 10 20:22:34 2024 +0100
runtime(netrw): directory symlink not resolved in tree view
closes: https://github.com/vim/vim/issues/16020
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 6799a3444..d11c43a49 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -34,6 +34,7 @@
" 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964)
" 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the
search history
" 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing
(#15996)
+" 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view
(#16020)
" }}}
" Former Maintainer: Charles E Campbell
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
@@ -4585,6 +4586,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,cursor,...)
if a:cursor && exists("w:netrw_liststyle") && w:netrw_liststyle ==
s:TREELIST && exists("w:netrw_treetop")
" dirname is the path to the word under the cursor
let dirname = s:NetrwTreePath(w:netrw_treetop)
+ " newdir resolves to a directory and points to a directory in dirname
+ " /tmp/test/folder_symlink/ -> /tmp/test/original_folder/
+ if a:islocal && fnamemodify(dirname, ':t') == newdir &&
isdirectory(resolve(dirname)) && resolve(dirname) == resolve(newdir)
+ let dirname = fnamemodify(resolve(dirname), ':p:h:h')
+ let newdir = fnamemodify(resolve(newdir), ':t')
+ endif
" Remove trailing "/"
let dirname = substitute(dirname, "/$", "", "")
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tADdL-00CCPn-RS%40256bit.org.