From: Mark Woods Date: Sat, 18 Jul 2026 13:25:17 +0000 (+0000) Subject: patch 9.2.0792: runtime(netrw): Explore without optional dir broken X-Git-Tag: v9.2.0792^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1eede2bf020035cf9617ade4b313a4cbef08b9ad;p=thirdparty%2Fvim.git patch 9.2.0792: runtime(netrw): Explore without optional dir broken Problem: runtime(netrw): Explore without optional [dir] argument should open directory of the current file Solution: Make it work as documented (Mark Woods) Broken by fix for #20636 in PR #20663 related: #20663 closes: #20761 Signed-off-by: Mark Woods Signed-off-by: Christian Brabandt --- diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim index d82dd90768..bbb2deb00f 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -1,7 +1,7 @@ " Creator: Charles E Campbell " Previous Maintainer: Luca Saccarola " Maintainer: This runtime file is looking for a new maintainer. -" Last Change: 2026 Jul 17 +" Last Change: 2026 Jul 18 " 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 @@ -571,6 +571,9 @@ function netrw#Explore(indx,dosplit,style,...) endif if starpat == 0 && a:indx >= 0 + if dirname == "" + let dirname= curfiledir + endif " [Explore Hexplore Vexplore Sexplore] [dirname] if dirname =~# '^scp://' || dirname =~ '^ftp://' call netrw#Nread(2,dirname) diff --git a/src/testdir/test_plugin_netrw.vim b/src/testdir/test_plugin_netrw.vim index a6dcf33e04..2530b0a70f 100644 --- a/src/testdir/test_plugin_netrw.vim +++ b/src/testdir/test_plugin_netrw.vim @@ -901,4 +901,15 @@ func Test_netrw_open_backslash_file() bw! endfunc +" :Explore without a [dir] argument should open the dir of the current file +func Test_netrw_open_no_dir_arg() + let dir = tempname() + call mkdir(dir, 'pR') + call writefile([], dir . '/foo') + exe 'edit ' . dir . '/foo' + Explore + call assert_equal(fnamemodify(dir, ':p'), fnamemodify(b:netrw_curdir, ':p')) + bw! +endfunc + " vim:ts=8 sts=2 sw=2 et diff --git a/src/version.c b/src/version.c index 77d596c04e..9118c769d8 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 792, /**/ 791, /**/