diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-28 18:17:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-28 18:17:41 +0200 |
commit | 477db060eb91dbef6698b6c69ffd560557f2f3ae (patch) | |
tree | a0bddbfc95c9bf7cbe27d46675457cae420982a5 /runtime/autoload/tar.vim | |
parent | 6e202e52b725f7c0a77837dbb0dc0d85c1d74733 (diff) |
More runtime file updates.
Diffstat (limited to 'runtime/autoload/tar.vim')
-rw-r--r-- | runtime/autoload/tar.vim | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 3e44579ce1..508405341b 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -1,7 +1,7 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Dec 28, 2009 -" Version: 24 +" Date: Jul 27, 2010 +" Version: 25 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " License: Vim License (see vim's :help license) " @@ -22,7 +22,7 @@ if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v24" +let g:loaded_tar= "v25" if v:version < 702 echohl WarningMsg echo "***warning*** this version of tar needs vim 7.2" @@ -164,6 +164,9 @@ fun! tar#Browse(tarfile) 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." - " + 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." - " else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -265,10 +268,13 @@ fun! tar#Read(fname,mode) elseif fname =~ '\.lzma$' && executable("lzcat") let decmp= "|lzcat" let doro = 1 + elseif fname =~ '\.xz$' && executable("xzcat") + let decmp= "|xzcat" + let doro = 1 else let decmp="" let doro = 0 - if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$' + if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$' setlocal bin endif endif @@ -290,6 +296,9 @@ fun! tar#Read(fname,mode) 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 + 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 else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -388,17 +397,22 @@ fun! tar#Write(fname) let tarfile = substitute(tarfile,'\.gz','','e') let compress= "gzip -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") - elseif tarfile =~# '\.lzma' - call system("lzma -d -- ".shellescape(tarfile,0)) - let tarfile = substitute(tarfile,'\.lzma','','e') - let compress= "lzma -- ".shellescape(tarfile,0) -" call Decho("compress<".compress.">") elseif tarfile =~# '\.tgz' call system("gzip -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') let compress= "gzip -- ".shellescape(tarfile,0) let tgz = 1 " call Decho("compress<".compress.">") + elseif tarfile =~# '\.xz' + call system("xz -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.xz','','e') + let compress= "xz -- ".shellescape(tarfile,0) +" call Decho("compress<".compress.">") + elseif tarfile =~# '\.lzma' + call system("lzma -d -- ".shellescape(tarfile,0)) + let tarfile = substitute(tarfile,'\.lzma','','e') + let compress= "lzma -- ".shellescape(tarfile,0) +" call Decho("compress<".compress.">") endif " call Decho("tarfile<".tarfile.">") |