Sublime Forum

[Solved] PHP figured brackets {} break HTML syntax inside of condition

#1

SublimeText version 3114 Windows 64bit.
File: test.php, used syntax highlight: php.

This example breaks all html autocomplete inside of php condition:

<?php if(1) { ?>
<input value="<?php echo 1; ?>" type="text">
<?php } ?>

Also, type=“text” is grey color.
Next example with colon is work fine:

<?php if(1): ?>
<input value="<?php echo 1; ?>" type="text">
<?php endif; ?>

Is there a way to fix this bug?

0 Likes

#2

I have noticed this same thing as well. Same build 3114 on Mac OS X 10.11.5

0 Likes

#3

This has been fixed at https://github.com/sublimehq/Packages and will be part of dev build 3115.

0 Likes

#4

Hello, another case for this issue:

If i mix PHP and HTML tags, the autocomplete for the PHP will be broke.

Example:

<?php $slides = get_field('slide_show'); if ($slides) { ?>
<section class="section-slider">
</section>
<?php } ?>

And trying to enter a “php” followed by a TAB it will not start me a new PHP code but it will complete “phpinfo”

0 Likes