pvk7 / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Editing files inside .zip files truncating the first line #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a minimal test case with:  echo 'line1\nline2' > test.txt && zip 
test.zip test.txt && echo 'set nocompatible' > vimrc && vim -u vimrc test.zip
2. Open test.txt inside test.zip in vim
3. The buffer contains line2 but not line1

What is the expected output? What do you see instead?
Expected output:
line1
line2

Actual output:
line2

What version of the product are you using? On what operating system?
vim 7.3.124 on linux

Please provide any additional information below.
This seems to be specific to zip.vim, it does not happen with tar files.

Original issue reported on code.google.com by adse...@calibre-ebook.com on 2 Jul 2013 at 7:59

GoogleCodeExporter commented 9 years ago
The attached patch, which makes zip#Read work like tar#Read fixes the bug:

Original comment by adse...@calibre-ebook.com on 2 Jul 2013 at 8:09

Attachments:

GoogleCodeExporter commented 9 years ago
This bug is apparently a regression caused by commit  22fa3049e934

https://code.google.com/p/vim/source/diff?spec=svn941318315acee2d9840fb4e4776035
678a510b60&r=22fa3049e9348a8ce556a3e5ba65c6f0a7aa6b4a&format=side&path=/runtime/
autoload/zip.vim&old_path=/runtime/autoload/zip.vim&old=af1e8a1714c2e5baa63f5a76
9b25b37452e5bb6c

The idea (based on the comments in that commit) was to make files edited inside 
zip files useable with quickfix lists. I dont really understand why it causes 
the first line to be discarded, but I'm no vim guru.

Original comment by adse...@calibre-ebook.com on 2 Jul 2013 at 8:23

GoogleCodeExporter commented 9 years ago
Try zip.vim v27, available at my website:  
http://www.drchip.org/astronaut/vim/index.html#ZIP

Original comment by drc...@campbellfamily.biz on 2 Jul 2013 at 2:29

GoogleCodeExporter commented 9 years ago
That works, thanks.

Original comment by adse...@calibre-ebook.com on 2 Jul 2013 at 3:33