@@ -19,7 +19,7 @@ if &cp || exists("g:loaded_netrw")
19
19
finish
20
20
endif
21
21
22
- let g: loaded_netrw = " v183 "
22
+ let g: loaded_netrw = " v184 "
23
23
24
24
if ! has (" patch-9.1.1054" ) && ! has (' nvim' )
25
25
echoerr ' netrw needs Vim v9.1.1054'
@@ -4861,7 +4861,6 @@ function s:NetrwMaps(islocal)
4861
4861
nnoremap <buffer> <silent> <nowait> mg :<c-u> call <SID> NetrwMarkFileGrep(1)<cr>
4862
4862
nnoremap <buffer> <silent> <nowait> mh :<c-u> call <SID> NetrwMarkHideSfx(1)<cr>
4863
4863
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>
4865
4864
nnoremap <buffer> <silent> <nowait> mr :<c-u> call <SID> NetrwMarkFileRegexp(1)<cr>
4866
4865
nnoremap <buffer> <silent> <nowait> ms :<c-u> call <SID> NetrwMarkFileSource(1)<cr>
4867
4866
nnoremap <buffer> <silent> <nowait> mT :<c-u> call <SID> NetrwMarkFileTag(1)<cr>
@@ -4973,7 +4972,6 @@ function s:NetrwMaps(islocal)
4973
4972
nnoremap <buffer> <silent> <nowait> mg :<c-u> call <SID> NetrwMarkFileGrep(0)<cr>
4974
4973
nnoremap <buffer> <silent> <nowait> mh :<c-u> call <SID> NetrwMarkHideSfx(0)<cr>
4975
4974
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>
4977
4975
nnoremap <buffer> <silent> <nowait> mr :<c-u> call <SID> NetrwMarkFileRegexp(0)<cr>
4978
4976
nnoremap <buffer> <silent> <nowait> ms :<c-u> call <SID> NetrwMarkFileSource(0)<cr>
4979
4977
nnoremap <buffer> <silent> <nowait> mT :<c-u> call <SID> NetrwMarkFileTag(0)<cr>
@@ -5932,39 +5930,6 @@ function s:NetrwMarkFileMove(islocal)
5932
5930
5933
5931
endfunction
5934
5932
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
-
5968
5933
" s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2
5969
5934
" files when given a regexp (for which a prompt is
5970
5935
" issued) (matches to name of files).
@@ -6195,37 +6160,20 @@ endfunction
6195
6160
6196
6161
" s:NetrwOpenFile: query user for a filename and open it {{{2
6197
6162
function s: NetrwOpenFile (islocal)
6198
- let ykeep= @@
6199
6163
call inputsave ()
6200
- let fname= input (" Enter filename: " )
6164
+ let fname = input (" Enter filename: " )
6201
6165
call inputrestore ()
6202
6166
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
6212
6169
endif
6213
6170
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)
6229
6177
endfunction
6230
6178
6231
6179
" netrw#Shrink: shrinks/expands a netrw or Lexplorer window {{{2
@@ -6425,7 +6373,6 @@ function s:NetrwMenu(domenu)
6425
6373
exe ' sil! menu ' .g: NetrwMenuPriority .' .14.8 ' .g: NetrwTopLvlMenu .' Marked\ Files.Exe\ Cmd<tab>mx mx'
6426
6374
exe ' sil! menu ' .g: NetrwMenuPriority .' .14.9 ' .g: NetrwTopLvlMenu .' Marked\ Files.Move\ To\ Target<tab>mm mm'
6427
6375
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'
6429
6376
exe ' sil! menu ' .g: NetrwMenuPriority .' .14.12 ' .g: NetrwTopLvlMenu .' Marked\ Files.Replace<tab>R R'
6430
6377
exe ' sil! menu ' .g: NetrwMenuPriority .' .14.13 ' .g: NetrwTopLvlMenu .' Marked\ Files.Set\ Target<tab>mt mt'
6431
6378
exe ' sil! menu ' .g: NetrwMenuPriority .' .14.14 ' .g: NetrwTopLvlMenu .' Marked\ Files.Tag<tab>mT mT'
0 commit comments