Skip to content

Commit 0bda783

Browse files
saccarosiumchrisbra
authored andcommitted
runtime(netrw): upstream snapshot v184
This change includes the following upstream commits: - fix: remove black lines in directory listing - fix: correctly create new file when using Lexplore - refactor: remove print functionality The main highlight is removing print functionality that was broken both in neovim and vim. closes: #17847 Signed-off-by: Luca Saccarola <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 8274830 commit 0bda783

File tree

5 files changed

+11
-89
lines changed

5 files changed

+11
-89
lines changed

runtime/doc/pi_netrw.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
9090
Marked Files: Grep..................................|netrw-mg|
9191
Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh|
9292
Marked Files: Moving................................|netrw-mm|
93-
Marked Files: Printing..............................|netrw-mp|
9493
Marked Files: Sourcing..............................|netrw-ms|
9594
Marked Files: Setting the Target Directory..........|netrw-mt|
9695
Marked Files: Tagging...............................|netrw-mT|
@@ -1066,7 +1065,6 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
10661065
mg Apply vimgrep to marked files |netrw-mg|
10671066
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
10681067
mm Move marked files to marked-file target directory |netrw-mm|
1069-
mp Print marked files |netrw-mp|
10701068
mr Mark files using a shell-style |regexp| |netrw-mr|
10711069
mt Current browsing directory becomes markfile target |netrw-mt|
10721070
mT Apply ctags to marked files |netrw-mT|
@@ -2001,7 +1999,6 @@ The following netrw maps make use of marked files:
20011999
|netrw-mF| Unmark marked files
20022000
|netrw-mg| Apply vimgrep to marked files
20032001
|netrw-mm| Move marked files to target
2004-
|netrw-mp| Print marked files
20052002
|netrw-ms| Netrw will source marked files
20062003
|netrw-mt| Set target for |netrw-mm| and |netrw-mc|
20072004
|netrw-mT| Generate tags using marked files
@@ -2266,15 +2263,6 @@ from the current window (where one does the mf) to the target.
22662263

22672264
Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
22682265

2269-
MARKED FILES: PRINTING *netrw-mp* {{{2
2270-
(See |netrw-mf| and |netrw-mr| for how to mark files)
2271-
(uses the local marked file list)
2272-
2273-
When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
2274-
What netrw does is open each file in a one-line window, execute hardcopy, then
2275-
close the one-line window.
2276-
2277-
22782266
MARKED FILES: SOURCING *netrw-ms* {{{2
22792267
(See |netrw-mf| and |netrw-mr| for how to mark files)
22802268
(uses the local marked file list)

runtime/doc/tags

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9204,7 +9204,6 @@ netrw-mm pi_netrw.txt /*netrw-mm*
92049204
netrw-modify pi_netrw.txt /*netrw-modify*
92059205
netrw-mouse pi_netrw.txt /*netrw-mouse*
92069206
netrw-move pi_netrw.txt /*netrw-move*
9207-
netrw-mp pi_netrw.txt /*netrw-mp*
92089207
netrw-mr pi_netrw.txt /*netrw-mr*
92099208
netrw-ms pi_netrw.txt /*netrw-ms*
92109209
netrw-mt pi_netrw.txt /*netrw-mt*

runtime/pack/dist/opt/netrw/autoload/netrw.vim

Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if &cp || exists("g:loaded_netrw")
1919
finish
2020
endif
2121

22-
let g:loaded_netrw = "v183"
22+
let g:loaded_netrw = "v184"
2323

2424
if !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

59335931
endfunction
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-
1split
5959-
" the autocmds will handle both local and remote files
5960-
exe "sil NetrwKeepj e ".fnameescape(fname)
5961-
hardcopy
5962-
q
5963-
endfor
5964-
2match 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
61976162
function 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)
62296177
endfunction
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'

runtime/pack/dist/opt/netrw/doc/netrw.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
9090
Marked Files: Grep..................................|netrw-mg|
9191
Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh|
9292
Marked Files: Moving................................|netrw-mm|
93-
Marked Files: Printing..............................|netrw-mp|
9493
Marked Files: Sourcing..............................|netrw-ms|
9594
Marked Files: Setting the Target Directory..........|netrw-mt|
9695
Marked Files: Tagging...............................|netrw-mT|
@@ -1066,7 +1065,6 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
10661065
mg Apply vimgrep to marked files |netrw-mg|
10671066
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
10681067
mm Move marked files to marked-file target directory |netrw-mm|
1069-
mp Print marked files |netrw-mp|
10701068
mr Mark files using a shell-style |regexp| |netrw-mr|
10711069
mt Current browsing directory becomes markfile target |netrw-mt|
10721070
mT Apply ctags to marked files |netrw-mT|
@@ -2001,7 +1999,6 @@ The following netrw maps make use of marked files:
20011999
|netrw-mF| Unmark marked files
20022000
|netrw-mg| Apply vimgrep to marked files
20032001
|netrw-mm| Move marked files to target
2004-
|netrw-mp| Print marked files
20052002
|netrw-ms| Netrw will source marked files
20062003
|netrw-mt| Set target for |netrw-mm| and |netrw-mc|
20072004
|netrw-mT| Generate tags using marked files
@@ -2266,15 +2263,6 @@ from the current window (where one does the mf) to the target.
22662263

22672264
Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
22682265

2269-
MARKED FILES: PRINTING *netrw-mp* {{{2
2270-
(See |netrw-mf| and |netrw-mr| for how to mark files)
2271-
(uses the local marked file list)
2272-
2273-
When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
2274-
What netrw does is open each file in a one-line window, execute hardcopy, then
2275-
close the one-line window.
2276-
2277-
22782266
MARKED FILES: SOURCING *netrw-ms* {{{2
22792267
(See |netrw-mf| and |netrw-mr| for how to mark files)
22802268
(uses the local marked file list)

runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if &cp || exists("g:loaded_netrwPlugin")
1515
finish
1616
endif
1717

18-
let g:loaded_netrwPlugin = "v183"
18+
let g:loaded_netrwPlugin = "v184"
1919

2020
let s:keepcpo = &cpo
2121
set cpo&vim

0 commit comments

Comments
 (0)