My apologies, but attached is the correct patch.
Thank you all.
Take care,
Vincent Batts
http://slackware.com/~vbatts/
On Sun, Mar 7, 2010 at 10:37 AM, Vincent Batts <[email protected]> wrote:
> To who ever reviews submissions for patches,
>
> Problem: Files using the xz (formerly lzma), the tar.vim runtime
> autoloader does not match on and decompress the file. Causing the
> buffer to be raw data.
> Solution: Add a case to the tar.vim to match on files like
> '.(xz|txz)' and properly decompress the contents to stdout
> Files: runtime/autoload/tar.vim
> runtime/plugin/tarPlugin.vim
>
> Take care,
> Vincent Batts
> http://slackware.com/~vbatts/
>
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -ur vim72.orig/runtime/autoload/tar.vim vim72/runtime/autoload/tar.vim
--- vim72.orig/runtime/autoload/tar.vim 2008-08-09 09:14:58.000000000 -0500
+++ vim72/runtime/autoload/tar.vim 2010-03-07 10:24:14.324541518 -0600
@@ -142,6 +142,9 @@
elseif tarfile =~# '\.bz2$'
" call Decho("3: exe silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
+ elseif tarfile =~# '\.\(xz\|txz\)$'
+" call Decho("3: exe silent r! xz --decompress --stdout -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! xz --decompress --stdout -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
else
if tarfile =~ '^\s*-'
" A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
@@ -264,6 +267,9 @@
elseif tarfile =~# '\.bz2$'
" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp)
exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
+ elseif tarfile =~# '\.\(xz\|txz\)$'
+" call Decho("3: exe silent r! xz --decompress --stdout -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ").tar_secure.s:Escape(fname,1).decmp
+ exe "silent r! xz --decompress --stdout -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
else
if tarfile =~ '^\s*-'
" A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
@@ -371,6 +377,17 @@
let tarfile = substitute(tarfile,'\.bz2','','e')
let compress= "bzip2 -- ".s:Escape(tarfile,0)
" call Decho("compress<".compress.">")
+ elseif tarfile =~# '\.xz'
+ call system("xz --decompress -- ".s:Escape(tarfile,0))
+ let tarfile = substitute(tarfile,'\.xz','','e')
+ let compress= "xz -- ".s:Escape(tarfile,0)
+" call Decho("compress<".compress.">")
+ elseif tarfile =~# '\.txz'
+ call system("xz --decompress -- ".s:Escape(tarfile,0))
+ let tarfile = substitute(tarfile,'\.txz','.tar','e')
+ let compress= "xz -- ".s:Escape(tarfile,0)
+ let txz = 1
+" call Decho("compress<".compress.">")
endif
" call Decho("tarfile<".tarfile.">")
diff -ur vim72.orig/runtime/plugin/tarPlugin.vim vim72/runtime/plugin/tarPlugin.vim
--- vim72.orig/runtime/plugin/tarPlugin.vim 2008-08-08 16:05:33.000000000 -0500
+++ vim72/runtime/plugin/tarPlugin.vim 2010-03-07 10:33:37.051544563 -0600
@@ -40,6 +40,8 @@
au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.txz call tar#Browse(expand("<amatch>"))
augroup END
" ---------------------------------------------------------------------