Mercurial > vim
comparison runtime/autoload/gzip.vim @ 6336:4abac79c0b7a
Update runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 05 Nov 2014 17:02:17 +0100 |
parents | 0b796e045c42 |
children | 876fbdd84e52 |
comparison
equal
deleted
inserted
replaced
6335:11fad096bd54 | 6336:4abac79c0b7a |
---|---|
1 " Vim autoload file for editing compressed files. | 1 " Vim autoload file for editing compressed files. |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | 2 " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 " Last Change: 2008 Jul 04 | 3 " Last Change: 2014 Nov 05 |
4 | 4 |
5 " These functions are used by the gzip plugin. | 5 " These functions are used by the gzip plugin. |
6 | 6 |
7 " Function to check that executing "cmd [-f]" works. | 7 " Function to check that executing "cmd [-f]" works. |
8 " The result is cached in s:have_"cmd" for speed. | 8 " The result is cached in s:have_"cmd" for speed. |
118 " delete the temp file and the used buffers | 118 " delete the temp file and the used buffers |
119 call delete(tmp) | 119 call delete(tmp) |
120 silent! exe "bwipe " . tmp_esc | 120 silent! exe "bwipe " . tmp_esc |
121 silent! exe "bwipe " . tmpe_esc | 121 silent! exe "bwipe " . tmpe_esc |
122 endif | 122 endif |
123 " Store the OK flag, so that we can use it when writing. | |
124 let b:uncompressOk = ok | |
123 | 125 |
124 " Restore saved option values. | 126 " Restore saved option values. |
125 let &pm = pm_save | 127 let &pm = pm_save |
126 let &cpo = cpo_save | 128 let &cpo = cpo_save |
127 let &l:ma = ma_save | 129 let &l:ma = ma_save |
144 endif | 146 endif |
145 endfun | 147 endfun |
146 | 148 |
147 " After writing compressed file: Compress written file with "cmd" | 149 " After writing compressed file: Compress written file with "cmd" |
148 fun gzip#write(cmd) | 150 fun gzip#write(cmd) |
151 if exists('b:uncompressOk') && !b:uncompressOk | |
152 echomsg "Not compressing file because uncompress failed; reset b:uncompressOk to compress anyway" | |
149 " don't do anything if the cmd is not supported | 153 " don't do anything if the cmd is not supported |
150 if s:check(a:cmd) | 154 elseif s:check(a:cmd) |
151 " Rename the file before compressing it. | 155 " Rename the file before compressing it. |
152 let nm = resolve(expand("<afile>")) | 156 let nm = resolve(expand("<afile>")) |
153 let nmt = s:tempname(nm) | 157 let nmt = s:tempname(nm) |
154 if rename(nm, nmt) == 0 | 158 if rename(nm, nmt) == 0 |
155 if exists("b:gzip_comp_arg") | 159 if exists("b:gzip_comp_arg") |