patch 9.2.0792: runtime(netrw): Explore without optional dir broken
Commit:
https://github.com/vim/vim/commit/1eede2bf020035cf9617ade4b313a4cbef08b9ad
Author: Mark Woods <
mwoods.o...@gmail.com>
Date: Sat Jul 18 13:25:17 2026 +0000
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 <
mwoods.o...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
index d82dd9076..bbb2deb00 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 <
github...@aleeas.com>
" 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 a6dcf33e0..2530b0a70 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 77d596c04..9118c769d 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,
/**/