-
-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Reproduce:
- Open tar archive (such as this one: link) in vim.
- Open a file inside it by pressing
<CR> - Press
- - See the error:
tar: /home/username/Downloads/tarfile\:\:doc: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Expected behavior
Either
- See error message (e.g.
vim-vinegar: This mapping is not supported inside tar archives.)
OR
- Show directory of current file as would happen with a normal file (see additional information below).
Additional information
The manner vim's tar handler uses to open a file is not what you might expect. When opening a file with <CR>, it does wincmd _ (link) to open a maximized split. Therefore, I'm not sure how the "expected behavior" would be achieved. Assuming the original window is still there, I suppose - would just be :q? And if that window doesn't exist, then the directory would open in the current window? That's assuming you can get the filepath for the original directory, which I'm not sure is available, because when in the buffer of the opened file, the output of expand('%') is /home/username/Downloads/tarfile::doc/pi_vimball.txt, showing the correct directory has been replaced by tarfile::doc.
Also, the same original error shows if you unzip the archive first.