update block and line highlightning

This commit is contained in:
Silver Kuusik
2018-08-18 19:12:05 +02:00
parent 2af99f108b
commit 22adce4b9e
4 changed files with 23 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
// Blockly workspace
var workspace;
window.addEventListener('load', function() {
// To remember the control_if blockId
var controlBlockId = '';
@@ -219,7 +222,7 @@ window.addEventListener('load', function() {
if (event.type != Blockly.Events.CHANGE && event.type != Blockly.Events.MOVE) return;
// Show the code in the ace editor, filter out block IDs
readOnlyCodingEditor.setValue('\n' + Blockly.Python.workspaceToCode(workspace).replace(/;;.{20}/g, ''));
readOnlyCodingEditor.setValue(Blockly.Python.workspaceToCode(workspace).replace(/;;.{20}/g, ''));
readOnlyCodingEditor.clearSelection();
// Save the code to the local storage