" Creator: Charles E Campbell
" Previous Maintainer: Luca Saccarola <github.e41mv@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
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)
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