A bug has come to light in Zen for me. I think I’m using the most up-to-date version of Zen, and I’m on b2098 of ST2. I think the bug’s been around as long as I’ve known Zen on ST2. Anyway on to the bug:
The main bug here is that in PHP, if I place the caret in the middle of some PHP and hit the alt+shift+w command, any variable references (e.g., ‘$variable’) inside the PHP disappear. My assumption is that it has something to do with the dollar sign followed by word characters means something special which is somehow being clobbered by Zen.
So say you had this HTML:
<span><?php echo 'hi'; ?></span>
<span><?php echo $variable; ?></span>
<span><?php echo $object->property; ?></span>
After wrapping each line individually (for simplicity) you end up with:
<span><a href=""><?php echo 'hi'; ?></a></span>
<span><a href=""><?php echo ; ?></a></span>
<span><a href=""><?php echo ->property; ?></a></span>
Another thing I’m experiencing which may or may not be a bug is that if these PHP snippets weren’t individually wrapped in HTML tags (in this case span but it can be anything in my testing) it treats the three lines of PHP as a single block and therefore will wrap the ‘a’ (in this case) around the three lines as a whole rather than each line getting its own ‘a’. Now, I have a feeling this may be how the plugin is supposed to work, as it will never be able to predict whether an HTML author means a list or a non-breaking paragraph (the normal HTML whitespace rules) by multiple lines with no separating tags. Having said that, I think that for the most part, the preferred behaviour would be broken lines. I know this can be done by selecting multiple lines, pressing c+s+l to split lines, and then Zenning, but I think that default behaviour for Zen really could be straight select then Zen treats the lines as separate entities. I bet that >90% of the time people do that they mean it as if the lines are separate. But feel free to correct me, other developers.