vim-patch:67abf1592c83

runtime(tar): comment out strange error condition check

67abf1592c

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Clason
2023-11-14 17:31:59 +01:00
parent 7e0f6211af
commit c37f7bdba5

View File

@@ -1,7 +1,7 @@
" tar.vim: Handles browsing tarfiles " tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION " AUTOLOAD PORTION
" Date: Nov 05, 2023 " Date: Nov 14, 2023
" Version: 32a (with modifications from the Vim Project) " Version: 32b (with modifications from the Vim Project)
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" License: Vim License (see vim's :help license) " License: Vim License (see vim's :help license)
" "
@@ -208,27 +208,24 @@ fun! tar#Browse(tarfile)
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">") " call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
return return
endif endif
" If there was an error message, the last line probably matches some keywords but
" should also contain whitespace for readability. Make sure not to match a
" filename that contains the keyword (error/warning/unrecognized/inappropriate, etc)
" "
" FIXME:is this actually necessary? In case of an error, we should probably " The following should not be neccessary, since in case of errors the
" have noticed in the if statement above since tar should have exited " previous if statement should have caught the problem (because tar exited
" with a non-zero exit code. " with a non-zero exit code).
if line("$") == curlast || ( line("$") == (curlast + 1) && " if line("$") == curlast || ( line("$") == (curlast + 1) &&
\ getline("$") =~# '\c\<\%(warning\|error\|inappropriate\|unrecognized\)\>' && " \ getline("$") =~# '\c\<\%(warning\|error\|inappropriate\|unrecognized\)\>' &&
\ getline("$") =~ '\s' ) " \ getline("$") =~ '\s' )
redraw! " redraw!
echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None " echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None
keepj sil! %d " keepj sil! %d
let eikeep= &ei " let eikeep= &ei
set ei=BufReadCmd,FileReadCmd " set ei=BufReadCmd,FileReadCmd
exe "r ".fnameescape(a:tarfile) " exe "r ".fnameescape(a:tarfile)
let &ei= eikeep " let &ei= eikeep
keepj sil! 1d " keepj sil! 1d
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">") " call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
return " return
endif " endif
" set up maps supported for tar " set up maps supported for tar
setlocal noma nomod ro setlocal noma nomod ro