Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Aug 18, 2015 · 4 comments
Closed

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

That works, thanks.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant