fidian / hexmode

Vim plugin to edit binary files in a hex mode automatically.
147 stars 19 forks source link

E54: Unmatched ( #21

Closed mentaal closed 7 years ago

mentaal commented 7 years ago

I am sure this likely a problem on my environment and has nothing to do this Plugin but I'm hoping I can get some help here regardless.

I am currently using Vundle as my Vim package manager. My vimrc has this in it pertaining to Hexmode:

"Hexmode
Plugin 'fidian/hexmode'
"can switch with - :Hexmode

When I launch gvim (on windows) I get the following in a popup window:

Error detected while processing C:\Users\gkuhn\vimfiles\bundle\hexmode\plugin\hexmode.vim:
line   89:
E54: Unmatched (
E54: Unmatched (

I am using Vim: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 11 2016 22:05:36)

fidian commented 7 years ago

I am not the original author and I am mostly stumbling through vimscript myself. However, I will do what I can to help out.

Line 89 looks like this for me, does it look like this for you?

 87         " Gzipped help files show up as binary in (and only in) BufReadPost.
 88         execute printf('au BufReadPre {%s}/doc/*.txt.gz let b:allow_hexmode     = 0',
 89             \ escape(&rtp, ' '))

I am using Vim on Linux. It appears that we are using either the same version or nearly the same version, so that's good.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
mentaal commented 7 years ago

Yeah, the code I have is identical alright. I have used this plugin before without issue which leads me to further think it's something on my side. I unfortunately don't have a clue about vimscript.

I am using Windows 7 x64. Incidentally, Hexmode still works for me anyway so not a big deal. Just a pop up annoyance. I might just comment/remove the autocmd stuff for the moment. Thanks!

fidian commented 7 years ago

I guess the best thing I can suggest is for you to disable all plugins except Hexmode and then add them back in one by one, testing along the way to see where Vim reports errors. I've had a problem like that before and it was caused by the combination of two other plugins. Pretty nasty to diagnose because when you think you found the plugin and you enable Hexmode + that one other plugin then the bug doesn't show up.

chaoren commented 7 years ago

Hi, I wrote that line.

Could you try changing

        execute printf('au BufReadPre {%s}/doc/*.txt.gz let b:allow_hexmode = 0',
            \ escape(&rtp, ' '))

to

        execute printf('au BufReadPre {%s}/doc/*.txt.gz let b:allow_hexmode = 0', escape(&rtp, ' '))

and see if it works?

chaoren commented 7 years ago

If you could run :echo escape(&rtp, ' ') in vim and paste the output, that would help too.

mentaal commented 7 years ago

Hi Chaoren, thanks for the suggestions. I tried removing the line break but that didn't help. I also tried it at the ex prompt which also reported the unmatched bracket.

I'll try Fidian's suggestion and remove other plugins to hopefully isolate the culprit.

chaoren commented 7 years ago

Interesting, I think the issue might be your runtime path, and not any other plugin. Please try :echo &rtp and paste the output. I'm guessing it's because you're on Windows, so you get things like \, (, and ) in your path.

mentaal commented 7 years ago

Hi Chaoren, I below is a copy of the output :echo &rtp reformatted into multiple lines to be more human readable The */after appears to be normal and is added by Vundle, the package manager I am using.

I did try removing all of my plugins and reinstalling them with Vundle and the hexmode unmatched ( error appeared again during the update.

C:\Users\gkuhn/vimfiles
C:\Users\gkuhn\.vim\bundle\Vundle.vim
C:\Users\gkuhn\.vim\bundle\vim-colorschemes
C:\Users\gkuhn\.vim\bundle\ctrlp.vim
C:\Users\gkuhn\.vim\bundle\vim-flake8
C:\Users\gkuhn\.vim\bundle\supertab
C:\Users\gkuhn\.vim\bundle\taglist.vim
C:\Users\gkuhn\.vim\bundle\nerdcommenter
C:\Users\gkuhn\.vim\bundle\python-syntax
C:\Users\gkuhn\.vim\bundle\hexmode
C:\Users\gkuhn\.vim\bundle\vim-systemverilog
C:\Program Files\gvim/vimfiles
C:\Program Files\gvim
C:\Program Files\gvim/vimfiles/after
C:\Users\gkuhn/vimfiles/after
C:\Users\gkuhn/.vim/bundle/Vundle.vim
C:\Users\gkuhn\.vim\bundle\Vundle.vim/after
C:\Users\gkuhn\.vim\bundle\vim-colorschemes/after
C:\Users\gkuhn\.vim\bundle\ctrlp.vim/after
C:\Users\gkuhn\.vim\bundle\vim-flake8/after
C:\Users\gkuhn\.vim\bundle\supertab/after
C:\Users\gkuhn\.vim\bundle\taglist.vim/after
C:\Users\gkuhn\.vim\bundle\nerdcommenter/after
C:\Users\gkuhn\.vim\bundle\python-syntax/after
C:\Users\gkuhn\.vim\bundle\hexmode/after
C:\Users\gkuhn\.vim\bundle\vim-systemverilog/after
mentaal commented 7 years ago

I updated to Vim8 and changed my plugin manager to Dein which seems to have resolved any problems I have been having :)