Re: [vim/vim] runtime(zip)!: Customizable zip/unzip commands (PR #20832)
curbe454 (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/20832/[email protected]> |
curbe454 left a comment (vim/vim#20832)
The default commands use `zip` and `unzip`, and I tried using `7z`:
```vim
let g:zip_browse= ["printf", "'';",
\ "7zlbaf() { 7z l -ba \"$@\" | awk '{print ($3 ~ /D[^[:space:]]{4}/ ? $6 \"/\" : $6)}'; }",
\ " && ", "7zlbaf"] " or save command as a file with `#!/bin/sh`
let g:zip_read= ["7z", "x", "-so"]
let g:zip_extract= ["7z", "x"]
let g:zip_delete= ["7z", "d"]
let g:zip_update= ["7z", "u"]
```
I found that 7z behaviors different on file names with special characters, such as [`a[a].txt`](https://github.com/vim/vim/blob/975e191dc817d8d00abca7197c4529a417c2f805/src/testdir/test_plugin_zip.vim#L187:194) or [`a*.txt`](https://github.com/vim/vim/blob/975e191dc817d8d00abca7197c4529a417c2f805/src/testdir/test_plugin_zip.vim#L196:L203). For example:
```sh
$ ls zipglob
'a[a].txt' 'a*.txt' 'a?.txt' 'a\.txt' 'a\\.txt'
$ wc -l 'zipglob/a*.txt'
1 zipglob/a*.txt
$ unzip -p exp.zip 'zipglob/a\*.txt' | wc -l
1
$ 7z x -so exp.zip 'zipglob/a\*.txt' | wc -l
2
```
This means the behavior of visiting(read/write) files that contains special character in a zip file without `zip`/`unzip` is unpredictable.
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20832#issuecomment-5073124820
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/20832/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20832/c5073124820%40github.com.