Mercurial > vim
comparison runtime/autoload/zip.vim @ 5130:71e066e10a47 v7.3.1308
updated for version 7.3.1308
Problem: Typos in MS-Windows build settings and README.
Solution: Minor changes to MS-Windows files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 04 Jul 2013 22:50:40 +0200 |
parents | 22fa3049e934 |
children | b7da8d4c594c |
comparison
equal
deleted
inserted
replaced
5129:fd80611c5f83 | 5130:71e066e10a47 |
---|---|
1 " zip.vim: Handles browsing zipfiles | 1 " zip.vim: Handles browsing zipfiles |
2 " AUTOLOAD PORTION | 2 " AUTOLOAD PORTION |
3 " Date: Apr 17, 2013 | 3 " Date: Jul 02, 2013 |
4 " Version: 26 | 4 " Version: 27 |
5 " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> | 5 " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> |
6 " License: Vim License (see vim's :help license) | 6 " License: Vim License (see vim's :help license) |
7 " Copyright: Copyright (C) 2005-2012 Charles E. Campbell {{{1 | 7 " Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1 |
8 " Permission is hereby granted to use and distribute this code, | 8 " Permission is hereby granted to use and distribute this code, |
9 " with or without modifications, provided that this copyright | 9 " with or without modifications, provided that this copyright |
10 " notice is copied with it. Like anything else that's free, | 10 " notice is copied with it. Like anything else that's free, |
11 " zip.vim and zipPlugin.vim are provided *as is* and comes with | 11 " zip.vim and zipPlugin.vim are provided *as is* and comes with |
12 " no warranty of any kind, either expressed or implied. By using | 12 " no warranty of any kind, either expressed or implied. By using |
13 " this plugin, you agree that in no event will the copyright | 13 " this plugin, you agree that in no event will the copyright |
14 " holder be liable for any damages resulting from the use | 14 " holder be liable for any damages resulting from the use |
15 " of this software. | 15 " of this software. |
16 "redraw!|call DechoSep()|call inputsave()|call input("Press <cr> to continue")|call inputrestore() | |
16 | 17 |
17 " --------------------------------------------------------------------- | 18 " --------------------------------------------------------------------- |
18 " Load Once: {{{1 | 19 " Load Once: {{{1 |
19 if &cp || exists("g:loaded_zip") | 20 if &cp || exists("g:loaded_zip") |
20 finish | 21 finish |
21 endif | 22 endif |
22 let g:loaded_zip= "v26" | 23 let g:loaded_zip= "v27" |
23 if v:version < 702 | 24 if v:version < 702 |
24 echohl WarningMsg | 25 echohl WarningMsg |
25 echo "***warning*** this version of zip needs vim 7.2" | 26 echo "***warning*** this version of zip needs vim 7.2" |
26 echohl Normal | 27 echohl Normal |
27 finish | 28 finish |
28 endif | 29 endif |
29 let s:keepcpo= &cpo | 30 let s:keepcpo= &cpo |
30 set cpo&vim | 31 set cpo&vim |
32 "DechoTabOn | |
31 | 33 |
32 let s:zipfile_escape = ' ?&;\' | 34 let s:zipfile_escape = ' ?&;\' |
33 let s:ERROR = 2 | 35 let s:ERROR = 2 |
34 let s:WARNING = 1 | 36 let s:WARNING = 1 |
35 let s:NOTE = 0 | 37 let s:NOTE = 0 |
58 | 60 |
59 " --------------------------------------------------------------------- | 61 " --------------------------------------------------------------------- |
60 " zip#Browse: {{{2 | 62 " zip#Browse: {{{2 |
61 fun! zip#Browse(zipfile) | 63 fun! zip#Browse(zipfile) |
62 " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") | 64 " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") |
65 " sanity check: insure that the zipfile has "PK" as its first two letters | |
66 " (zipped files have a leading PK as a "magic cookie") | |
67 if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' | |
68 exe "noautocmd e ".fnameescape(a:zipfile) | |
69 " call Dret("zip#Browse : not a zipfile<".a:zipfile.">") | |
70 return | |
71 " else " Decho | |
72 " call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - its a zip file") | |
73 endif | |
74 | |
63 let repkeep= &report | 75 let repkeep= &report |
64 set report=10 | 76 set report=10 |
65 | 77 |
66 " sanity checks | 78 " sanity checks |
67 if !exists("*fnameescape") | 79 if !exists("*fnameescape") |
195 | 207 |
196 " the following code does much the same thing as | 208 " the following code does much the same thing as |
197 " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1) | 209 " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1) |
198 " but allows zipfile:... entries in quickfix lists | 210 " but allows zipfile:... entries in quickfix lists |
199 let temp = tempname() | 211 let temp = tempname() |
212 " call Decho("using temp file<".temp.">") | |
200 let fn = expand('%:p') | 213 let fn = expand('%:p') |
201 exe "sil! !".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1).' > '.temp | 214 exe "sil! !".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1).' > '.temp |
202 " call Decho("exe sil! !".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1).' > '.temp) | 215 " call Decho("exe sil! !".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1).' > '.temp) |
203 sil exe 'keepalt file '.temp | 216 sil exe 'keepalt file '.temp |
204 sil keepj e! | 217 sil keepj e! |
206 call delete(temp) | 219 call delete(temp) |
207 | 220 |
208 filetype detect | 221 filetype detect |
209 | 222 |
210 " cleanup | 223 " cleanup |
211 keepj 0d | 224 " keepj 0d " used to be needed for the ...r! ... method |
212 set nomod | 225 set nomod |
213 | 226 |
214 let &report= repkeep | 227 let &report= repkeep |
215 " call Dret("zip#Read") | 228 " call Dret("zip#Read") |
216 endfun | 229 endfun |