Do not assume an indentation of 2 spaces when writing the global variables at the top of a function declaration. (#1356)

This commit is contained in:
Nicole Parrot
2017-10-10 19:06:40 -04:00
committed by Rachel Fenichel
parent fb774c9b67
commit 4df6f11f8a

View File

@@ -44,7 +44,7 @@ Blockly.Python['procedures_defreturn'] = function(block) {
Blockly.Variables.NAME_TYPE));
}
}
globals = globals.length ? ' global ' + globals.join(', ') + '\n' : '';
globals = globals.length ? Blockly.Python.INDENT + 'global ' + globals.join(', ') + '\n' : '';
var funcName = Blockly.Python.variableDB_.getName(block.getFieldValue('NAME'),
Blockly.Procedures.NAME_TYPE);
var branch = Blockly.Python.statementToCode(block, 'STACK');