On Friday, July 14, 2017 at 7:55:31 AM UTC-5, Tyler Akins wrote:
> First off, I apologize for my lack of VimScript knowledge. I have adopted a 
> plugin that will allow users to edit files in hex when using vim -b and it 
> has the possibility of automatically editing files based on extensions or by 
> detecting high characters in a file. Editing the hex and saving the file will 
> automatically convert the hex back into binary. Pretty useful for data files 
> of various types.
> 
> The goal of this issue is to gain further understanding of VimScript and why 
> the plugin is conflicting with gzip. Hopefully people here are smarter than 
> me and can educate me in what I did wrong and how to avoid the issue.
> 
> A user of this plugin reported [a 
> problem](https://github.com/fidian/hexmode/issues/27] when loading a 
> compressed help file. These compressed help files are automatically excluded 
> from being edited by a check against the filename in my s:IsBinary function, 
> which is called on BufReadPost.
> au BufReadPost *
>     \ let &l:binary = s:IsBinary() |
>     \ if &l:binary |
>     \   Hexmode |
>     \ endif
> 
> 
> When editing a compressed help file, the following is displayed in vim:
> Error detected while processing function gzip#read:
> line 44:
> Error: Could not read uncompressed file
> E434: Can't find tag pattern
> 
> 
> I can even change s:IsBinary to simply do nothing and return 0 and the 
> problem is still triggered. Commenting out the BufReadPost commands allow the 
> file to be loaded and viewed (as text) correctly.
> 
> So, my question is revolving around my inability to understand why those 
> commands are triggering problems in the gzip plugin. Can anyone shed some 
> light on my plight?
> 
> 

Is your Hexmode command defined to allow a | to separate it from another 
command? I.e. did you use "command -bar Hexmode ..." to define it?

If you did not specify the "-bar" option, then the "| endif" is seen as an 
argument to the Hexmode command, and your "if" in unclosed. That could in 
theory prevent other BufReadPost autocmds from doing anything.

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui