Skip to content

VinegarUp() fails in buffer of file inside tar archive #139

Description

@jmdevin

Reproduce:

  1. Open tar archive (such as this one: link) in vim.
  2. Open a file inside it by pressing <CR>
  3. Press -
  4. 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

  1. See error message (e.g. vim-vinegar: This mapping is not supported inside tar archives.)

OR

  1. 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions