annotate runtime/plugin/netrwPlugin.vim @ 1431:d065616e0836 v7.1.146

updated for version 7.1-146
author vimboss
date Mon, 29 Oct 2007 21:38:54 +0000
parents 2b8ff9e3c520
children 46bbe11644e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
1 " netrwPlugin.vim: Handles file transfer and remote directory listing across a network
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
2 " PLUGIN SECTION
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
3 " Date: Jan 05, 2007
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
4 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
5 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
6 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
7 " Permission is hereby granted to use and distribute this code,
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
8 " with or without modifications, provided that this copyright
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
9 " notice is copied with it. Like anything else that's free,
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
10 " netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
11 " *as is* and comes with no warranty of any kind, either
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
12 " expressed or implied. By using this plugin, you agree that
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
13 " in no event will the copyright holder be liable for any damages
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
14 " resulting from the use of this software.
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
15 "
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
16 " But be doers of the Word, and not only hearers, deluding your own selves {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
17 " (James 1:22 RSV)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
18 " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
19
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
20 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
21 " Load Once: {{{1
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
22 if &cp || exists("g:loaded_netrwPlugin")
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
23 finish
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
24 endif
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
25 let g:loaded_netrwPlugin = 1
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
26 let s:keepcpo = &cpo
553
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
27 if v:version < 700
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
28 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
29 finish
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
30 endif
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
31 let s:keepcpo= &cpo
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
32 set cpo&vim
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
33
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
34 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
35 " Public Interface: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
36
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
37 " Local Browsing: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
38 augroup FileExplorer
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
39 au!
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
40 au BufEnter * silent! call s:LocalBrowse(expand("<amatch>"))
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
41 if has("win32") || has("win95") || has("win64") || has("win16")
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
42 au BufEnter .* silent! call s:LocalBrowse(expand("<amatch>"))
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
43 endif
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
44 augroup END
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
45
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
46 " Network Browsing Reading Writing: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
47 augroup Network
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
48 au!
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
49 if has("win32") || has("win95") || has("win64") || has("win16")
557
862863033fdd updated for version 7.0158
vimboss
parents: 553
diff changeset
50 au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
51 else
557
862863033fdd updated for version 7.0158
vimboss
parents: 553
diff changeset
52 au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
862863033fdd updated for version 7.0158
vimboss
parents: 553
diff changeset
53 au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
54 endif
718
7b21554be7a1 updated for version 7.0219
vimboss
parents: 649
diff changeset
55 au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe '2Nread "'.expand("<amatch>").'"'|exe "silent doau BufReadPost ".expand("<amatch>")
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
56 au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe 'Nread "' .expand("<amatch>").'"'|exe "silent doau FileReadPost ".expand("<amatch>")
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
57 au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe 'Nwrite "' .expand("<amatch>").'"'|exe "silent doau BufWritePost ".expand("<amatch>")
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
58 au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']".'Nwrite "' .expand("<amatch>").'"'|exe "silent doau FileWritePost ".expand("<amatch>")
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
59 try
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
60 au SourceCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
61 catch /^Vim\%((\a\+)\)\=:E216/
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
62 au SourcePre ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
63 endtry
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
64 augroup END
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
65
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
66 " Commands: :Nread, :Nwrite, :NetUserPass {{{2
718
7b21554be7a1 updated for version 7.0219
vimboss
parents: 649
diff changeset
67 com! -count=1 -nargs=* Nread call netrw#NetSavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#NetRestorePosn()
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
68 com! -range=% -nargs=* Nwrite call netrw#NetSavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#NetRestorePosn()
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
69 com! -nargs=* NetUserPass call NetUserPass(<f-args>)
718
7b21554be7a1 updated for version 7.0219
vimboss
parents: 649
diff changeset
70 com! -nargs=+ Ncopy call netrw#NetObtain(<f-args>)
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
71 com! -nargs=* Nsource call netrw#NetSavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#NetRestorePosn()
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
72
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
73 " Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
74 com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
75 com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
76 com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
77 com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
78 com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
79 com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
80 com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
81
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
82 " Commands: NetrwSettings {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
83 com! -nargs=0 NetrwSettings :call netrwSettings#NetrwSettings()
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
84
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
85 " Maps:
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
86 if !exists("g:netrw_nogx") && maparg('g','n') == ""
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
87 if !hasmapto('<Plug>NetrwBrowseX')
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
88 nmap <unique> gx <Plug>NetrwBrowseX
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
89 endif
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
90 nno <silent> <Plug>NetrwBrowseX :call netrw#NetBrowseX(expand("<cWORD>"),0)<cr>
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
91 endif
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
92
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
93 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
94 " LocalBrowse: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
95 fun! s:LocalBrowse(dirname)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
96 " unfortunate interaction -- debugging calls can't be used here;
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
97 " the BufEnter event causes triggering when attempts to write to
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
98 " the DBG buffer are made.
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
99 " echomsg "dirname<".a:dirname.">"
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
100 if has("amiga")
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
101 " The check against '' is made for the Amiga, where the empty
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
102 " string is the current directory and not checking would break
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
103 " things such as the help command.
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
104 if a:dirname != '' && isdirectory(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
105 silent! call netrw#LocalBrowseCheck(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
106 endif
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
107 elseif isdirectory(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
108 " echomsg "dirname<".dirname."> isdir"
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
109 silent! call netrw#LocalBrowseCheck(a:dirname)
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
110 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
111 " not a directory, ignore it
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
112 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
113
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
114 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
115 " NetrwStatusLine: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
116 fun! NetrwStatusLine()
755
d01e3133478f updated for version 7.0224
vimboss
parents: 718
diff changeset
117 " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
d01e3133478f updated for version 7.0224
vimboss
parents: 718
diff changeset
118 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")
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
119 let &stl= s:netrw_explore_stl
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
120 if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
121 if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
122 return ""
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
123 else
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
124 return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
125 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
126 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
127
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
128 " ------------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
129 " NetUserPass: set username and password for subsequent ftp transfer {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
130 " Usage: :call NetUserPass() -- will prompt for userid and password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
131 " :call NetUserPass("uid") -- will prompt for password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
132 " :call NetUserPass("uid","password") -- sets global userid and password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
133 fun! NetUserPass(...)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
134
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
135 " get/set userid
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
136 if a:0 == 0
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
137 " call Dfunc("NetUserPass(a:0<".a:0.">)")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
138 if !exists("g:netrw_uid") || g:netrw_uid == ""
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
139 " via prompt
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
140 let g:netrw_uid= input('Enter username: ')
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
141 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
142 else " from command line
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
143 " call Dfunc("NetUserPass(a:1<".a:1.">) {")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
144 let g:netrw_uid= a:1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
145 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
146
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
147 " get password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
148 if a:0 <= 1 " via prompt
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
149 " call Decho("a:0=".a:0." case <=1:")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
150 let g:netrw_passwd= inputsecret("Enter Password: ")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
151 else " from command line
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
152 " call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
153 let g:netrw_passwd=a:2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
154 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
155 " call Dret("NetUserPass")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
156 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
157
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
158 " ------------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
159 " NetReadFixup: this sort of function is typically written by the user {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
160 " to handle extra junk that their system's ftp dumps
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
161 " into the transfer. This function is provided as an
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
162 " example and as a fix for a Windows 95 problem: in my
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
163 " experience, win95's ftp always dumped four blank lines
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
164 " at the end of the transfer.
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
165 if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
166 fun! NetReadFixup(method, line1, line2)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
167 " call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
168 if method == 3 " ftp (no <.netrc>)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
169 let fourblanklines= line2 - 3
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
170 silent fourblanklines.",".line2."g/^\s*/d"
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
171 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
172 " call Dret("NetReadFixup")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
173 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
174 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
175
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
176 " ------------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
177 " Modelines And Restoration: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
178 let &cpo= s:keepcpo
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
179 unlet s:keepcpo
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
180 " vim:ts=8 fdm=marker