Skip to content

Commit

Permalink
Track variable rename events in blockly.
Browse files Browse the repository at this point in the history
  • Loading branch information
acbart committed Aug 9, 2020
1 parent e7d7db3 commit 3635b9c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
55 changes: 38 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/block_mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Blockly.Variables.nameUsedWithOtherType_ = function (name, type, workspace) {
return null;
};

Blockly.Variables.nameUsedWithAnyType = function (name, workspace) {
Blockly.Variables.nameUsedWithAnyType_ = function (name, workspace) {
var allVariables = workspace.getVariableMap().getAllVariables();

for (var i = 0, variable; variable = allVariables[i]; i++) {
Expand Down Expand Up @@ -1146,7 +1146,7 @@ BlockMirrorBlockEditor.prototype.setCode = function (code, quietly) {
}
};

BlockMirrorBlockEditor.prototype.BLOCKLY_CHANGE_EVENTS = [Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE, Blockly.Events.MOVE];
BlockMirrorBlockEditor.prototype.BLOCKLY_CHANGE_EVENTS = [Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE, Blockly.Events.MOVE, Blockly.Events.VAR_RENAME];

BlockMirrorBlockEditor.prototype.changed = function (event) {
if ((event === undefined || this.BLOCKLY_CHANGE_EVENTS.indexOf(event.type) !== -1) && !this.workspace.isDragging()) {
Expand Down
3 changes: 2 additions & 1 deletion src/block_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ BlockMirrorBlockEditor.prototype.setCode = function (code, quietly) {
}

BlockMirrorBlockEditor.prototype.BLOCKLY_CHANGE_EVENTS = [
Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE, Blockly.Events.MOVE
Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE,
Blockly.Events.MOVE, Blockly.Events.VAR_RENAME
];

BlockMirrorBlockEditor.prototype.changed = function (event) {
Expand Down

0 comments on commit 3635b9c

Please sign in to comment.