Line wrap comments in generated code.

This commit is contained in:
Neil Fraser
2016-06-08 00:12:58 -07:00
parent 4ba2b1bea3
commit 3012d52808
7 changed files with 180 additions and 155 deletions

View File

@@ -167,6 +167,7 @@ Blockly.PHP.scrub_ = function(block, code) {
if (!block.outputConnection || !block.outputConnection.targetConnection) {
// Collect comment for this block.
var comment = block.getCommentText();
comment = Blockly.utils.wrap(comment, this.COMMENT_WRAP - 3);
if (comment) {
commentCode += Blockly.PHP.prefixLines(comment, '// ') + '\n';
}