vim-patch:2249cc0: runtime(netrw): remove the fun from netrw :)

closes: vim/vim#17584

2249cc0a47

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
This commit is contained in:
Jaehwang Jung
2025-09-13 01:49:51 +09:00
parent 7b2a42e962
commit b643e1f3d5
2 changed files with 352 additions and 445 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -54,7 +54,7 @@ augroup END
command! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos)
command! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
command! -nargs=* NetUserPass call NetUserPass(<f-args>)
command! -nargs=* NetUserPass call netrw#NetUserPass(<f-args>)
command! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
command! -nargs=? Ntree call netrw#SetTreetop(1,<q-args>)
@@ -143,39 +143,17 @@ function! s:VimEnter(dirname)
endfunction
" }}}
" NetrwStatusLine: {{{
" Deprecated: {{{
function! NetrwStatusLine()
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
let &stl= s:netrw_explore_stl
unlet! w:netrw_explore_bufnr w:netrw_explore_line
return ""
function NetUserPass(...)
call netrw#msg#Deprecate('NetUserPass', 'v185', {
\ 'vim': 'netrw#NetUserPass()',
\ 'nvim': 'netrw#NetUserPass()'
\})
if a:0
call netrw#NetUserPass(a:000)
else
return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
endif
endfunction
" }}}
" NetUserPass: set username and password for subsequent ftp transfer {{{
" Usage: :call NetUserPass() -- will prompt for userid and password
" :call NetUserPass("uid") -- will prompt for password
" :call NetUserPass("uid","password") -- sets global userid and password
function! NetUserPass(...)
" get/set userid
if a:0 == 0
if !exists("g:netrw_uid") || g:netrw_uid == ""
" via prompt
let g:netrw_uid= input('Enter username: ')
endif
else " from command line
let g:netrw_uid= a:1
endif
" get password
if a:0 <= 1 " via prompt
let g:netrw_passwd= inputsecret("Enter Password: ")
else " from command line
let g:netrw_passwd=a:2
call netrw#NetUserPass()
endif
endfunction