Skip to content

Commit

Permalink
vim-patch:5b63b23: runtime(netrw): directory symlink not resolved in …
Browse files Browse the repository at this point in the history
…tree view (neovim#31161)

closes: vim/vim#16020

vim/vim@5b63b23

Co-authored-by: Christian Brabandt <[email protected]>
  • Loading branch information
zeertzjq and chrisbra authored Nov 11, 2024
1 parent f37d290 commit 7906532
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runtime/autoload/netrw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -4580,6 +4581,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, "/$", "", "")

Expand Down

0 comments on commit 7906532

Please sign in to comment.