Skip to content

Commit 5f83674

Browse files
MiguelBarrochrisbra
authored andcommitted
runtime(netrw): Ensure netrw#fs#Dirname() always returns a trailing slash
closes: #18199 Signed-off-by: Miguel Barro <miguel.barro@live.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent d2b28dd commit 5f83674

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/pack/dist/opt/netrw/autoload/netrw.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
" 2025 Aug 07 by Vim Project (use correct "=~#" for netrw_stylesize option #17901)
66
" 2025 Aug 07 by Vim Project (netrw#BrowseX() distinguishes remote files #17794)
77
" 2025 Aug 22 by Vim Project netrw#Explore handle terminal correctly #18069
8+
" 2025 Sep 05 by Vim Project ensure netrw#fs#Dirname() returns trailing slash #18199
89
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
910
" Permission is hereby granted to use and distribute this code,
1011
" with or without modifications, provided that this copyright

runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ endfunction
8787
" netrw#fs#Dirname: {{{
8888

8989
function netrw#fs#Dirname(path)
90-
return netrw#fs#AbsPath(a:path)->fnamemodify(':h')
90+
" Keep a slash as directory recognition pattern
91+
return netrw#fs#AbsPath(a:path) . s:slash
9192
endfunction
9293

9394
" }}}

0 commit comments

Comments
 (0)