diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-06-19 05:09:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-06-19 05:09:16 +0200 |
commit | 251e19127170e7387da1f10b9c99c957b16477fc (patch) | |
tree | b286383f88539796b7ce8d724cf9872f8910bf72 /runtime | |
parent | d6761c3cdf9d15c0f64253dcd8049ff9f25aa987 (diff) |
Updated runtime files.
Diffstat (limited to 'runtime')
47 files changed, 938 insertions, 535 deletions
diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index 6e019764f3..9e2a1964c6 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -1,8 +1,8 @@ " --------------------------------------------------------------------- " getscript.vim " Author: Charles E. Campbell, Jr. -" Date: Dec 28, 2009 -" Version: 32 +" Date: May 31, 2011 +" Version: 33 " Installing: :help glvs-install " Usage: :help glvs " @@ -15,7 +15,7 @@ if exists("g:loaded_getscript") finish endif -let g:loaded_getscript= "v32" +let g:loaded_getscript= "v33" if &cp echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" finish @@ -519,6 +519,7 @@ fun! s:GetOneScript(...) " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself " -------------------------------------------------------------------------- +" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall) if doautoinstall " call Decho(" ") " call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname)) @@ -526,7 +527,7 @@ fun! s:GetOneScript(...) " call Decho("<".sname."> is readable") " call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) - let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #") + let curdir = fnameescape(substitute(getcwd(),'\','/','ge')) let installdir= curdir."/Installed" if !isdirectory(installdir) call mkdir(installdir) @@ -557,6 +558,11 @@ fun! s:GetOneScript(...) exe "silent !gunzip ".shellescape(sname) let sname= substitute(sname,'\.gz$','','') " call Decho("decompress: new sname<".sname."> after gunzip") + elseif sname =~ '\.xz$' +" call Decho("decompress: attempt to unxz ".sname) + exe "silent !unxz ".shellescape(sname) + let sname= substitute(sname,'\.xz$','','') +" call Decho("decompress: new sname<".sname."> after unxz") else " call Decho("no decompression needed") endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 8476022f7c..ab6370a8e9 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Apr 01, 2011 -" Version: 141 +" Date: May 31, 2011 +" Version: 142 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2010 Charles E. Campbell, Jr. {{{1 @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v141" +let g:loaded_netrw = "v142" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrw needs vim 7.2" @@ -291,7 +291,7 @@ call s:NetrwInit("g:netrw_timefmt","%c") call s:NetrwInit("g:netrw_xstrlen",0) call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.") call s:NetrwInit("g:netrw_win95ftp",1) -call s:NetrwInit("g:netrw_winsize",25) +call s:NetrwInit("g:netrw_winsize",50) " --------------------------------------------------------------------- " Default values for netrw's script variables: {{{2 call s:NetrwInit("g:netrw_fname_escape",' ?&;%') @@ -1518,6 +1518,14 @@ endfun fun! s:NetrwMethod(choice) " call Dfunc("NetrwMethod(a:choice<".a:choice.">)") + " sanity check: choice should have at least three slashes in it + if strlen(substitute(a:choice,'[^/]','','g')) < 3 + call netrw#ErrorMsg(s:ERROR,"not a netrw-style url; netrw uses protocol://[user@]hostname[:port]/[path])",78) + let b:netrw_method = -1 +" call Dret("NetrwMethod : incorrect url format<".a:choice.">") + return + endif + " record current g:netrw_machine, if any " curmachine used if protocol == ftp and no .netrc if exists("g:netrw_machine") @@ -1813,6 +1821,25 @@ endfun " s:NetrwMaps: {{{2 fun! s:NetrwMaps(islocal) " call Dfunc("s:NetrwMaps(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">") + + " set up Rexplore and [ 2-leftmouse-click -or- c-leftmouse ] +" call Decho("set up Rexplore command") + com! Rexplore call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".") + if g:netrw_mousemaps && g:netrw_retmap +" call Decho("set up Rexplore 2-leftmouse") + if !hasmapto("<Plug>NetrwReturn") + if maparg("<2-leftmouse>","n") == "" || maparg("<2-leftmouse>","n") =~ '^-$' +" call Decho("making map for 2-leftmouse") + nmap <unique> <silent> <2-leftmouse> <Plug>NetrwReturn + elseif maparg("<c-leftmouse>","n") == "" +" call Decho("making map for c-leftmouse") + nmap <unique> <silent> <c-leftmouse> <Plug>NetrwReturn + endif + endif + nno <silent> <Plug>NetrwReturn :Rexplore<cr> +" call Decho("made <Plug>NetrwReturn map") + endif + if a:islocal " call Decho("make local maps") inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr> @@ -1925,15 +1952,22 @@ fun! s:NetrwMaps(islocal) endif let mapsafecurdir = escape(b:netrw_curdir, s:netrw_map_escape) if g:netrw_mousemaps == 1 - nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call <SID>NetrwLeftmouse(1)<cr> - nnoremap <buffer> <silent> <middlemouse> <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr> - nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> - nmap <buffer> <silent> <2-leftmouse> - + nmap <buffer> <leftmouse> <Plug>NetrwLeftmouse + nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(1)<cr> + nmap <buffer> <middlemouse> <Plug>NetrwMiddlemouse + nno <buffer> <silent> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr> + nmap <buffer> <s-leftmouse> <Plug>NetrwSLeftmouse + nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> + nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse + nmap <buffer> <silent> <Plug>Netrw2Leftmouse - + imap <buffer> <leftmouse> <Plug>ILeftmouse + ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr> + imap <buffer> <middlemouse> <Plug>IMiddlemouse + ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr> + imap <buffer> <s-leftmouse> <Plug>ISLeftmouse + ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' - inoremap <buffer> <silent> <leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(1)<cr> - inoremap <buffer> <silent> <middlemouse> <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(1)<cr> - inoremap <buffer> <silent> <s-leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr> exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' endif exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>' @@ -2053,17 +2087,24 @@ fun! s:NetrwMaps(islocal) let mapsafepath = escape(s:path, s:netrw_map_escape) let mapsafeusermach = escape(s:user.s:machine, s:netrw_map_escape) - nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr> + nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr> if g:netrw_mousemaps == 1 - nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call <SID>NetrwLeftmouse(0)<cr> - nnoremap <buffer> <silent> <middlemouse> <leftmouse>:call <SID>NetrwPrevWinOpen(0)<cr> - nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> - nmap <buffer> <silent> <2-leftmouse> - + nmap <leftmouse> <Plug>NetrwLeftmouse + nno <buffer> <silent> <Plug>NetrwLeftmouse <leftmouse>:call <SID>NetrwLeftmouse(0)<cr> + nmap <middlemouse> <Plug>NetrwMiddlemouse + nno <buffer> <silent> <middlemouse> <Plug>NetrwMiddlemouse <leftmouse>:call <SID>NetrwPrevWinOpen(0)<cr> + nmap <buffer> <s-leftmouse> <Plug>NetrwSLeftmouse + nno <buffer> <silent> <Plug>NetrwSLeftmouse <leftmouse>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> + nmap <buffer> <2-leftmouse> <Plug>Netrw2Leftmouse + nmap <buffer> <silent> <Plug>Netrw2Leftmouse - + imap <buffer> <leftmouse> <Plug>ILeftmouse + ino <buffer> <silent> <Plug>ILeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr> + imap <buffer> <middlemouse> <Plug>IMiddlemouse + ino <buffer> <silent> <Plug>IMiddlemouse <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr> + imap <buffer> <s-leftmouse> <Plug>ISLeftmouse + ino <buffer> <silent> <Plug>ISLeftmouse <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' - inoremap <buffer> <silent> <leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwLeftmouse(0)<cr> - inoremap <buffer> <silent> <middlemouse> <c-o><leftmouse><c-o>:call <SID>NetrwPrevWinOpen(0)<cr> - inoremap <buffer> <silent> <s-leftmouse> <c-o><leftmouse><c-o>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr> exe 'inoremap <buffer> <silent> <rightmouse> <c-o><leftmouse><c-o>:call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' endif exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.mapsafeusermach.'","'.mapsafepath.'")<cr>' @@ -2081,23 +2122,8 @@ fun! s:NetrwMaps(islocal) inoremap <buffer> <F1> <c-o>:he netrw-quickhelp<cr> endif - " set up Rexplore and leftmouse-double-click - com! Rexplore call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".") - if g:netrw_mousemaps && g:netrw_retmap - if !hasmapto("<Plug>NetrwReturn") - if maparg("<2-leftmouse>","n") == "" || maparg("<2-leftmouse>","n") =~ '^-$' -" call Decho("making map for 2-leftmouse") - nmap <unique> <silent> <2-leftmouse> <Plug>NetrwReturn - elseif maparg("<c-leftmouse>","n") == "" -" call Decho("making map for c-leftmouse") - nmap <unique> <silent> <c-leftmouse> <Plug>NetrwReturn - endif - endif - exe 'nnoremap <silent> <Plug>NetrwReturn :Rexplore<cr>' -" call Decho("made <Plug>NetrwReturn map") - endif - keepj call s:SetRexDir(a:islocal,b:netrw_curdir) + " call Dret("s:NetrwMaps") endfun @@ -3647,34 +3673,40 @@ fun! netrw#Explore(indx,dosplit,style,...) if a:dosplit || &modified || a:style == 6 " call Decho("case dosplit=".a:dosplit." modified=".&modified." a:style=".a:style.": dosplit or file has been modified") call s:SaveWinVars() - let winsize= g:netrw_winsize + let winsz= g:netrw_winsize if a:indx > 0 - let winsize= a:indx + let winsz= a:indx endif if a:style == 0 " Explore, Sexplore " call Decho("style=0: Explore or Sexplore") - exe winsize."wincmd s" + let winsz= (winsz*winheight(0))/100 + exe winsz."wincmd s" elseif a:style == 1 "Explore!, Sexplore! " call Decho("style=1: Explore! or Sexplore!") - exe winsize."wincmd v" + let winsz= (winsz*winheight(0))/100 + exe winsz."wincmd v" elseif a:style == 2 " Hexplore " call Decho("style=2: Hexplore") - exe "bel ".winsize."wincmd s" + let winsz= (winsz*winheight(0))/100 + exe "bel ".winsz."wincmd s" elseif a:style == 3 " Hexplore! " call Decho("style=3: Hexplore!") - exe "abo ".winsize."wincmd s" + let winsz= (winsz*winheight(0))/100 + exe "abo ".winsz."wincmd s" elseif a:style == 4 " Vexplore " call Decho("style=4: Vexplore") - exe "lefta ".winsize."wincmd v" + let winsz= (winsz*winheight(0))/100 + exe "lefta ".winsz."wincmd v" elseif a:style == 5 " Vexplore! " call Decho("style=5: Vexplore!") - exe "rightb ".winsize."wincmd v" + let winsz= (winsz*winheight(0))/100 + exe "rightb ".winsz."wincmd v" elseif a:style == 6 " Texplore call s:SaveBufVars() @@ -4618,13 +4650,13 @@ fun! s:NetrwMarkFileCopy(islocal) " sanity checks if !exists("s:netrwmarkfilelist_{bufnr('%')}") || empty(s:netrwmarkfilelist_{bufnr('%')}) - keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) + keepj call netrw#ErrorMsg(s:ERROR,"there are no marked files in this window (:help netrw-mf)",66) " call Dret("s:NetrwMarkFileCopy 0") return 0 endif " call Decho("sanity chk passed: s:netrwmarkfilelist_".bufnr('%')."<".string(s:netrwmarkfilelist_{bufnr('%')})) if !exists("s:netrwmftgt") - keepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67) + keepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67) " call Dret("s:NetrwMarkFileCopy 0") return 0 endif @@ -6143,7 +6175,8 @@ fun! s:NetrwSplit(mode) if a:mode == 0 " remote and o " call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s") - exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" + let winsz= (g:netrw_winsize*winheight(0))/100 + exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" let s:didsplit= 1 keepj call s:RestoreWinVars() keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) @@ -6162,7 +6195,8 @@ fun! s:NetrwSplit(mode) elseif a:mode == 2 " remote and v " call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v") - exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" + let winsz= (g:netrw_winsize*winwidth(0))/100 + exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" let s:didsplit= 1 keepj call s:RestoreWinVars() keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) @@ -6171,7 +6205,8 @@ fun! s:NetrwSplit(mode) elseif a:mode == 3 " local and o " call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s") - exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" + let winsz= (g:netrw_winsize*winheight(0))/100 + exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" let s:didsplit= 1 keepj call s:RestoreWinVars() keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) @@ -6192,7 +6227,8 @@ fun! s:NetrwSplit(mode) elseif a:mode == 5 " local and v " call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v") - exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" + let winsz= (g:netrw_winsize*winwidth(0))/100 + exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" let s:didsplit= 1 keepj call s:RestoreWinVars() keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) @@ -6826,8 +6862,8 @@ fun! s:NetrwRemoteListing() " call Decho("2: exe sil r! ".listcmd) exe "sil! keepalt r! ".listcmd else -" call Decho("3: exe sil r! ".listcmd.' '.shellescape(s:path,1)) - exe "sil! keepalt r! ".listcmd.' '.shellescape(s:path,1) +" call Decho("3: exe sil r! ".listcmd.' '.shellescape(fnameescape(s:path),1)) + exe "sil! keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1) " call Decho("listcmd<".listcmd."> path<".s:path.">") endif endif @@ -7278,12 +7314,12 @@ fun! s:LocalListing() " get the list of files contained in the current directory let dirname = b:netrw_curdir let dirnamelen = s:Strlen(b:netrw_curdir) - let filelist = glob(s:ComposePath(dirname,"*")) + let filelist = glob(s:ComposePath(fnameescape(dirname),"*")) " call Decho("glob(dirname<".dirname."/*>)=".filelist) if filelist != "" let filelist= filelist."\n" endif - let filelist= filelist.glob(s:ComposePath(dirname,".*")) + let filelist= filelist.glob(s:ComposePath(fnameescape(dirname),".*")) " call Decho("glob(dirname<".dirname."/.*>)=".filelist) " Coding choice: either elide ./ if present @@ -7797,7 +7833,7 @@ endfun " 0=note = s:NOTE " 1=warning = s:WARNING " 2=error = s:ERROR -" Dec 03, 2009 : max errnum currently is 77 +" Apr 18, 2011 : max errnum currently is 78 fun! netrw#ErrorMsg(level,msg,errnum) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) @@ -8326,7 +8362,7 @@ endfun " --------------------------------------------------------------------- " s:RemotePathAnalysis: {{{2 fun! s:RemotePathAnalysis(dirname) -" call Dfunc("s:RemotePathAnalysis()") +" call Dfunc("s:RemotePathAnalysis(a:dirname<".a:dirname.">)") let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/:#]\+\)\%([:#]\(\d\+\)\)\=/\(.*\)$' let s:method = substitute(a:dirname,dirpat,'\1','') diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index becb790925..6355b71113 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,13 +1,13 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Aug 09, 2010 -" Version: 26 +" Date: May 31, 2011 +" Version: 27 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " License: Vim License (see vim's :help license) " " Contains many ideas from Michael Toren's <tar.vim> " -" Copyright: Copyright (C) 2005-2009 Charles E. Campbell, Jr. {{{1 +" Copyright: Copyright (C) 2005-2011 Charles E. Campbell, Jr. {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v26" +let g:loaded_tar= "v27" if v:version < 702 echohl WarningMsg echo "***warning*** this version of tar needs vim 7.2" @@ -47,6 +47,17 @@ endif if !exists("g:tar_writeoptions") let g:tar_writeoptions= "uf" endif +if !exists("g:netrw_cygwin") + if has("win32") || has("win95") || has("win64") || has("win16") + if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' + let g:netrw_cygwin= 1 + else + let g:netrw_cygwin= 0 + endif + else + let g:netrw_cygwin= 0 + endif +endif if !exists("g:tar_copycmd") if !exists("g:netrw_localcopycmd") if has("win32") || has("win95") || has("win64") || has("win16") @@ -63,17 +74,6 @@ if !exists("g:tar_copycmd") endif let g:tar_copycmd= g:netrw_localcopycmd endif -if !exists("g:netrw_cygwin") - if has("win32") || has("win95") || has("win64") || has("win16") - if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$' - let g:netrw_cygwin= 1 - else - let g:netrw_cygwin= 0 - endif - else - let g:netrw_cygwin= 0 - endif -endif if !exists("g:tar_extractcmd") let g:tar_extractcmd= "tar -xf" endif @@ -142,9 +142,9 @@ fun! tar#Browse(tarfile) call setline(lastline+1,'" tar.vim version '.g:loaded_tar) call setline(lastline+2,'" Browsing tarfile '.a:tarfile) call setline(lastline+3,'" Select a file with cursor and press ENTER') - $put ='' - 0d - $ + keepj $put ='' + keepj 0d + keepj $ let tarfile= a:tarfile if has("win32") && executable("cygpath") @@ -154,26 +154,26 @@ fun! tar#Browse(tarfile) let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lrp' " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.bz2$' " call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lzma$' " call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(xz\|txz\)$' " call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. let tarfile = substitute(tarfile, '-', './-', '') endif " call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,0)) - exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1) + exe "sil! r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1) endif if v:shell_error != 0 redraw! @@ -184,12 +184,12 @@ fun! tar#Browse(tarfile) if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)') redraw! echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None - silent %d + keepj sil! %d let eikeep= &ei set ei=BufReadCmd,FileReadCmd exe "r ".fnameescape(a:tarfile) let &ei= eikeep - 1d + keepj sil! 1d " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") return endif @@ -286,19 +286,19 @@ fun! tar#Read(fname,mode) endif if tarfile =~# '\.bz2$' " call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(gz\|tgz\)$' " call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) - exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lrp$' " call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "silent r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lzma$' " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(xz\|txz\)$' " call Decho("3: exe silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "silent r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -317,7 +317,7 @@ fun! tar#Read(fname,mode) exe "file tarfile::".fnameescape(fname) " cleanup |