diff options
-rw-r--r-- | runtime/autoload/zip.vim | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index 79f707fbd8..f77d729f03 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,6 +1,6 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Jul 24, 2024 +" Date: Jul 30, 2024 " Version: 33 " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E Campbell @@ -8,6 +8,7 @@ " 2024 Jun 16 by Vim Project: handle whitespace on Windows properly (#14998) " 2024 Jul 23 by Vim Project: fix 'x' command " 2024 Jul 24 by Vim Project: use delete() function +" 2024 Jul 20 by Vim Project: fix opening remote zipfile " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, @@ -73,15 +74,11 @@ endif " --------------------------------------------------------------------- " zip#Browse: {{{2 fun! zip#Browse(zipfile) -" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") - " sanity check: insure that the zipfile has "PK" as its first two letters - " (zipped files have a leading PK as a "magic cookie") - if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' - exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile) -" call Dret("zip#Browse : not a zipfile<".a:zipfile.">") + " sanity check: ensure that the zipfile has "PK" as its first two letters + " (zip files have a leading PK as a "magic cookie") + if filereadable(a:zipfile) && readblob(a:zipfile, 0, 2) != 0z50.4B + exe "noswapfile noautocmd e " .. fnameescape(a:zipfile) return -" else " Decho -" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - it's a zip file") endif let repkeep= &report @@ -97,9 +94,7 @@ fun! zip#Browse(zipfile) if !executable(g:zip_unzipcmd) redraw! echohl Error | echo "***error*** (zip#Browse) unzip not available on your system" -" call inputsave()|call input("Press <cr> to continue")|call inputrestore() let &report= repkeep -" call Dret("zip#Browse") return endif if !filereadable(a:zipfile) @@ -107,13 +102,10 @@ fun! zip#Browse(zipfile) " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None -" call inputsave()|call input("Press <cr> to continue")|call inputrestore() endif let &report= repkeep -" call Dret("zip#Browse : file<".a:zipfile."> not readable") return endif -" call Decho("passed sanity checks") if &ma != 1 set ma endif |