r367 - in trunk/vim/debian: . patches

Stefano Zacchiroli zack at costa.debian.org
Thu Oct 20 13:03:50 UTC 2005


Author: zack
Date: 2005-10-20 13:03:49 +0000 (Thu, 20 Oct 2005)
New Revision: 367

Added:
   trunk/vim/debian/patches/146_netrw.vim.diff
Modified:
   trunk/vim/debian/changelog
Log:
patch for netrw.vim wrt file:// URLs


Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog	2005-10-18 14:07:10 UTC (rev 366)
+++ trunk/vim/debian/changelog	2005-10-20 13:03:49 UTC (rev 367)
@@ -6,6 +6,8 @@
   [ Stefano Zacchiroli ]
   * Added "sources" debian/rules target which downloads upstream
     tarballs.
+  * Added patch 146_netrw.vim.diff, fixes some issues of netrw.vim with
+    file://* URLs. (closes: #334868)
   * Added patch 303_option.c.diff, which fixes 'system()' behaviour
     when $SHELL is empty. (closes: #219386)
   * Added patch 304_memline.c.diff, which fixes swap file locking wrt

Added: trunk/vim/debian/patches/146_netrw.vim.diff
===================================================================
--- trunk/vim/debian/patches/146_netrw.vim.diff	2005-10-18 14:07:10 UTC (rev 366)
+++ trunk/vim/debian/patches/146_netrw.vim.diff	2005-10-20 13:03:49 UTC (rev 367)
@@ -0,0 +1,68 @@
+diff -urN vim64/runtime/plugin/netrw.vim vim64.new/runtime/plugin/netrw.vim
+--- vim64/runtime/plugin/netrw.vim	2004-06-04 16:42:17.000000000 +0200
++++ vim64.new/runtime/plugin/netrw.vim	2005-10-20 14:58:39.000000000 +0200
+@@ -92,8 +92,8 @@
+   if has("win32")
+    au BufReadCmd  file://*		exe "doau BufReadPre ".expand("<afile>")|exe 'e '.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+   else
+-   au BufReadCmd  file:///*		exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+-   au BufReadCmd  file://localhost/*	exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
++   au BufReadCmd  file://*		exe "doau BufReadPre ".expand("<afile>")|exe 'e '.s:ExpandE("<afile>")|exe "doau BufReadPost ".expand("<afile>")
++   au BufReadCmd  file://localhost/*	exe "doau BufReadPre ".expand("<afile>")|exe 'e '.s:ExpandE("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+   endif
+   au BufReadCmd  ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "doau BufReadPre ".expand("<afile>")|exe "Nread 0r ".expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+   au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "doau BufReadPre ".expand("<afile>")|exe "Nread "   .expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+@@ -108,6 +108,53 @@
+ com! -nargs=*		NetUserPass	call NetUserPass(<f-args>)
+ 
+ " ------------------------------------------------------------------------
++" ExpandE: expand an argument for :e {{{1
++fun! s:ExpandE(s)
++  let r = a:s
++  let r = expand(r)
++  let r = substitute(r, "file://", "", "")
++  let r = s:UnescapeURI(r)
++  let r = s:EscapeForE(r)
++  return r
++endfun
++
++" UnescapeURI: expand URI escape sequences as per RFC2396 {{{2
++fun! s:UnescapeURI(uri)
++  let i = 0
++  let r = ""
++  while i < strlen(a:uri)
++    if a:uri[i] == "%"
++      let hexs = a:uri[i+1] . a:uri[i+2]
++      if hexs !~ "^\\x\\x$"
++        echoe "Invalid escape sequence \"" . a:uri[i] . hexs . "\""
++        return ""
++      endif
++      let r = r . nr2char("0x" . hexs)
++      let i = i + 3
++    else
++      let r = r . a:uri[i]
++      let i = i + 1
++    endif
++  endwhile
++  return r
++endfun
++
++" EscapeForE: make a string suitable as :e argument {{{2
++fun! s:EscapeForE(s)
++  let i = 0
++  let r = ""
++  while i < strlen(a:s)
++    if a:s[i] !~ "\\w"
++      let r = r . "\\" . a:s[i]
++    else
++      let r = r . a:s[i]
++    endif
++    let i = i + 1
++  endwhile
++  return r
++endfun
++
++" ------------------------------------------------------------------------
+ " NetSavePosn: saves position of cursor on screen {{{1
+ fun! s:NetSavePosn()
+ "  call Dfunc("NetSavePosn()")




More information about the pkg-vim-maintainers mailing list