Mercurial > vim
comparison runtime/plugin/gzip.vim @ 22:cc049b00ee70
updated for version 7.0014
author | vimboss |
---|---|
date | Thu, 02 Sep 2004 19:12:26 +0000 |
parents | 3fc0f57ecb91 |
children | 8eec9649b7a2 |
comparison
equal
deleted
inserted
replaced
21:db5102f7e29f | 22:cc049b00ee70 |
---|---|
1 " Vim plugin for editing compressed files. | 1 " Vim plugin for editing compressed files. |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | 2 " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 " Last Change: 2004 Jan 12 | 3 " Last Change: 2004 Jul 30 |
4 | 4 |
5 " Exit quickly when: | 5 " Exit quickly when: |
6 " - this plugin was already loaded | 6 " - this plugin was already loaded |
7 " - when 'compatible' is set | 7 " - when 'compatible' is set |
8 " - some autocommands are already taking care of compressed files | 8 " - some autocommands are already taking care of compressed files |
69 let tmpe = tmp . "." . expand("<afile>:e") | 69 let tmpe = tmp . "." . expand("<afile>:e") |
70 " write the just read lines to a temp file "'[,']w tmp.gz" | 70 " write the just read lines to a temp file "'[,']w tmp.gz" |
71 execute "silent '[,']w " . tmpe | 71 execute "silent '[,']w " . tmpe |
72 " uncompress the temp file: call system("gzip -dn tmp.gz") | 72 " uncompress the temp file: call system("gzip -dn tmp.gz") |
73 call system(a:cmd . " " . tmpe) | 73 call system(a:cmd . " " . tmpe) |
74 if !filereadable(tmp) | |
75 " uncompress didn't work! Keep the compressed file then. | |
76 echoerr "Error: Could not read uncompressed file" | |
77 return | |
78 endif | |
74 " delete the compressed lines; remember the line number | 79 " delete the compressed lines; remember the line number |
75 let l = line("'[") - 1 | 80 let l = line("'[") - 1 |
76 if exists(":lockmarks") | 81 if exists(":lockmarks") |
77 lockmarks '[,']d _ | 82 lockmarks '[,']d _ |
78 else | 83 else |