Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

closing php tag in string stops syntax highlighting

In my vim files, when I have a closing php tag in a string, my syntax highlighting stops at that point

Example:

<?php

...  Everything good up to this point

$xml = '<?xml version="1.0"?>';

$foo = 'bar'  <-- starting here I loose highlighting to the end of the file

?>

I'm running version 7.2.245. anyone have ideas why this happens? is it only me? or is this a known bug?

like image 979
veilig Avatar asked Jul 29 '10 21:07

veilig


3 Answers

  • Make sure you have the latest version of the runtime files, or at least the very latest version of the php syntax file.

  • Try using this alternative syntax file instead.

like image 111
too much php Avatar answered Nov 10 '22 21:11

too much php


It isnt a bug, you have actually ended the PHP string. you need to just break it up. Do like "'.'?'.'>' or something

like image 1
Mitch Dempsey Avatar answered Nov 10 '22 21:11

Mitch Dempsey


This is normal. Notice the SO syntax highlighter stopped highlighting at that point too ;)

My windows editor does the same thing.

like image 1
Byron Whitlock Avatar answered Nov 10 '22 20:11

Byron Whitlock