]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(netrw): Ensure netrw#fs#Dirname() always returns a trailing slash
authorMiguel Barro <miguel.barro@live.com>
Fri, 5 Sep 2025 09:33:56 +0000 (11:33 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 5 Sep 2025 09:35:00 +0000 (11:35 +0200)
closes: #18199

Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/pack/dist/opt/netrw/autoload/netrw.vim
runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim

index 1c98104d0053f27ee5c6bd87a9fb240e7bf52fb2..6863c222dfbaff709d15774d1a898de60aaa62cc 100644 (file)
@@ -5,6 +5,7 @@
 " 2025 Aug 07 by Vim Project (use correct "=~#" for netrw_stylesize option #17901)
 " 2025 Aug 07 by Vim Project (netrw#BrowseX() distinguishes remote files #17794)
 " 2025 Aug 22 by Vim Project netrw#Explore handle terminal correctly #18069
+" 2025 Sep 05 by Vim Project ensure netrw#fs#Dirname() returns trailing slash #18199
 " Copyright:  Copyright (C) 2016 Charles E. Campbell {{{1
 "             Permission is hereby granted to use and distribute this code,
 "             with or without modifications, provided that this copyright
index 5e530a8a5d9c8a2cc481b058087280d88896ae35..2f0841500be045119d3e6ef88e152e7d2bd63b91 100644 (file)
@@ -87,7 +87,8 @@ endfunction
 " netrw#fs#Dirname: {{{
 
 function netrw#fs#Dirname(path)
-    return netrw#fs#AbsPath(a:path)->fnamemodify(':h')
+    " Keep a slash as directory recognition pattern
+    return netrw#fs#AbsPath(a:path) . s:slash
 endfunction
 
 " }}}