Vim-PHP-Stuff icon indicating copy to clipboard operation
Vim-PHP-Stuff copied to clipboard

Parse warning

Open orlandu63 opened this issue 15 years ago • 4 comments

"php.php" [New File]
Error detected while processing /home/patrick/.vim/syntax/php.vim:
line   63:
E108: No such variable: "b:current_syntax"

my vim version:

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled May 16 2010 22:33:58)
Included patches: 1-436

orlandu63 avatar May 29 '10 01:05 orlandu63

Simply comment out the unlet b:current_syntax lines.

greut avatar Dec 17 '10 09:12 greut

Still helpful in 2012. Thanks :-)

mcs avatar Jan 12 '12 15:01 mcs

So there was another issue in another syntax file that led me to this issue with b:current_syntax. I'm not sure how this warning is happening since:

  1. every syntax file is supposed to declare a b:current_syntax file and
  2. I am using unlet! where the ! is not supposed to show a warning if the variable doesn't exist

I made a change to the runtime! syntax/html.vim on line 62 to remove the !, which means vim will stop including after the first html.vim file it finds. After updating to the latest commit are people still getting this warning?

If so which vim version? Do you have a custom html.vim in your runtimepath? Any other plugins or settings which might be causing verbose warning messages?

paulyg avatar Oct 13 '12 02:10 paulyg

changing the file inside this plugin fixes the problem, but when using vim togather with pathogen and git submodules this can get a bit messed up, since personal changes can't be pushed to origin (unless you are a contributor)

in order to make things work without problem, and still using pathogen for vim plugin management, you have to create a separat file, not part of a plugin which fixes this issue:

creating a syntax/html.vim file with the content

" fix for php plugin
let b:current_syntax='html'

fixed the issue without touching the submodule

i hope this helps people using pathogen ^^

W4RH4WK avatar Oct 18 '12 08:10 W4RH4WK