@@ -19,7 +19,7 @@ if &cp || exists("g:loaded_netrw")
1919 finish
2020endif
2121
22- let g: loaded_netrw = " v183 "
22+ let g: loaded_netrw = " v184 "
2323
2424if ! has (" patch-9.1.1054" ) && ! has (' nvim' )
2525 echoerr ' netrw needs Vim v9.1.1054'
@@ -4861,7 +4861,6 @@ function s:NetrwMaps(islocal)
48614861 nnoremap <buffer> <silent> <nowait> mg :<c-u> call <SID> NetrwMarkFileGrep(1)<cr>
48624862 nnoremap <buffer> <silent> <nowait> mh :<c-u> call <SID> NetrwMarkHideSfx(1)<cr>
48634863 nnoremap <buffer> <silent> <nowait> mm :<c-u> call <SID> NetrwMarkFileMove(1)<cr>
4864- nnoremap <buffer> <silent> <nowait> mp :<c-u> call <SID> NetrwMarkFilePrint(1)<cr>
48654864 nnoremap <buffer> <silent> <nowait> mr :<c-u> call <SID> NetrwMarkFileRegexp(1)<cr>
48664865 nnoremap <buffer> <silent> <nowait> ms :<c-u> call <SID> NetrwMarkFileSource(1)<cr>
48674866 nnoremap <buffer> <silent> <nowait> mT :<c-u> call <SID> NetrwMarkFileTag(1)<cr>
@@ -4973,7 +4972,6 @@ function s:NetrwMaps(islocal)
49734972 nnoremap <buffer> <silent> <nowait> mg :<c-u> call <SID> NetrwMarkFileGrep(0)<cr>
49744973 nnoremap <buffer> <silent> <nowait> mh :<c-u> call <SID> NetrwMarkHideSfx(0)<cr>
49754974 nnoremap <buffer> <silent> <nowait> mm :<c-u> call <SID> NetrwMarkFileMove(0)<cr>
4976- nnoremap <buffer> <silent> <nowait> mp :<c-u> call <SID> NetrwMarkFilePrint(0)<cr>
49774975 nnoremap <buffer> <silent> <nowait> mr :<c-u> call <SID> NetrwMarkFileRegexp(0)<cr>
49784976 nnoremap <buffer> <silent> <nowait> ms :<c-u> call <SID> NetrwMarkFileSource(0)<cr>
49794977 nnoremap <buffer> <silent> <nowait> mT :<c-u> call <SID> NetrwMarkFileTag(0)<cr>
@@ -5932,39 +5930,6 @@ function s:NetrwMarkFileMove(islocal)
59325930
59335931endfunction
59345932
5935- " s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2
5936- " using the hardcopy command. Local marked-file list only.
5937- function s: NetrwMarkFilePrint (islocal)
5938- let curbufnr= bufnr (" %" )
5939-
5940- " sanity check
5941- if ! exists (" s:netrwmarkfilelist_{curbufnr}" ) || empty (s: netrwmarkfilelist_ {curbufnr})
5942- call netrw#msg#Notify (' ERROR' , ' there are no marked files in this window (:help netrw-mf)' )
5943- return
5944- endif
5945- let curdir= s: NetrwGetCurdir (a: islocal )
5946-
5947- if exists (" s:netrwmarkfilelist_{curbufnr}" )
5948- let netrwmarkfilelist = s: netrwmarkfilelist_ {curbufnr}
5949- call s: NetrwUnmarkList (curbufnr,curdir)
5950- for fname in netrwmarkfilelist
5951- if a: islocal
5952- if g: netrw_keepdir
5953- let fname= netrw#fs#ComposePath (curdir,fname)
5954- endif
5955- else
5956- let fname= curdir.fname
5957- endif
5958- 1 split
5959- " the autocmds will handle both local and remote files
5960- exe " sil NetrwKeepj e " .fnameescape (fname)
5961- hardcopy
5962- q
5963- endfor
5964- 2 match none
5965- endif
5966- endfunction
5967-
59685933" s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2
59695934" files when given a regexp (for which a prompt is
59705935" issued) (matches to name of files).
@@ -6195,37 +6160,20 @@ endfunction
61956160
61966161" s:NetrwOpenFile: query user for a filename and open it {{{2
61976162function s: NetrwOpenFile (islocal)
6198- let ykeep= @@
61996163 call inputsave ()
6200- let fname= input (" Enter filename: " )
6164+ let fname = input (" Enter filename: " )
62016165 call inputrestore ()
62026166
6203- " determine if Lexplore is in use
6204- if exists (" t:netrw_lexbufnr" )
6205- " check if t:netrw_lexbufnr refers to a netrw window
6206- let lexwinnr = bufwinnr (t :netrw_lexbufnr)
6207- if lexwinnr != -1 && exists (" g:netrw_chgwin" ) && g: netrw_chgwin != -1
6208- exe " NetrwKeepj keepalt " .g: netrw_chgwin ." wincmd w"
6209- exe " NetrwKeepj e " .fnameescape (fname)
6210- let @ @= ykeep
6211- endif
6167+ if empty (fname)
6168+ return
62126169 endif
62136170
6214- " Does the filename contain a path?
6215- if fname !~ ' [/\\]'
6216- if exists (" b:netrw_curdir" )
6217- " save position for benefit of Rexplore
6218- let s: rexposn_ {bufnr (" %" )}= winsaveview ()
6219- if b: netrw_curdir = ~ ' /$'
6220- exe " NetrwKeepj e " .fnameescape (b: netrw_curdir .fname)
6221- else
6222- exe " e " .fnameescape (b: netrw_curdir ." /" .fname)
6223- endif
6224- endif
6225- else
6226- exe " NetrwKeepj e " .fnameescape (fname)
6227- endif
6228- let @ @= ykeep
6171+ " save position for benefit of Rexplore
6172+ let s: rexposn_ {bufnr (" %" )}= winsaveview ()
6173+
6174+ execute " NetrwKeepj e " . fnameescape (! isabsolutepath (fname)
6175+ \ ? netrw#fs#ComposePath (b: netrw_curdir , fname)
6176+ \ : fname)
62296177endfunction
62306178
62316179" netrw#Shrink: shrinks/expands a netrw or Lexplorer window {{{2
@@ -6425,7 +6373,6 @@ function s:NetrwMenu(domenu)
64256373 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.8 ' .g: NetrwTopLvlMenu .' Marked\ Files.Exe\ Cmd<tab>mx mx'
64266374 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.9 ' .g: NetrwTopLvlMenu .' Marked\ Files.Move\ To\ Target<tab>mm mm'
64276375 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.10 ' .g: NetrwTopLvlMenu .' Marked\ Files.Obtain<tab>O O'
6428- exe ' sil! menu ' .g: NetrwMenuPriority .' .14.11 ' .g: NetrwTopLvlMenu .' Marked\ Files.Print<tab>mp mp'
64296376 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.12 ' .g: NetrwTopLvlMenu .' Marked\ Files.Replace<tab>R R'
64306377 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.13 ' .g: NetrwTopLvlMenu .' Marked\ Files.Set\ Target<tab>mt mt'
64316378 exe ' sil! menu ' .g: NetrwMenuPriority .' .14.14 ' .g: NetrwTopLvlMenu .' Marked\ Files.Tag<tab>mT mT'
0 commit comments