Sublime Forum

[BUG] commenting out php using command + /

#1

When in an html file most things comment out nicely using the command + / shortcut, but php is doing this:

// <?php while (have_posts()) : the_post(); ?>

:open_mouth:

even if I’m in the php statement it does that

other things like a div for instance seem to comment out fine using HTML comments:

even if I’m not in the div

I’m assuming this is a bug, let me know though

(by the way Sublime Text Rules, I’m in the middle of making the switch from TextMate

brent
@

0 Likes

#2

Try editing Comment.tmPreferences in $PACKAGE_PATH/PHP/

This could likely be the cause of the issue:

			<dict>
				<key>name</key>
				<string>TM_COMMENT_START</string>
				<key>value</key>
				<string>// </string>
			</dict>
0 Likes

#3

way beyond me, I was more hoping that this would just be fixed in a future version of sublime… :sunglasses:

brent
@

0 Likes

#4

I’m having this same issue in ST3 still, but I don’t have a PHP folder under packages - where should this code go?

0 Likes

#5

This is a problem with how the PHP syntax is included in HTML and how ST assumes embedded languages are included, and a rather complex one to fix.

Reported at github.com/SublimeTextIssues/De … /issues/94

0 Likes

#6

Huh, interesting - I could swear this was working in ST2 as expected. Maybe I was using a plugin.

0 Likes

#7

It might. Afaik the PHP and HTML syntax have been updated/changed in ST3.

0 Likes