Skip to content

Commit 518fa9b

Browse files
committed
Plugin: Only skip duplicate work when BlockCode nodes selected
In dbd7643, an early return was added to avoid updating the UI when the same BlockCode node has been selected. When a non-BlockCode has been selected, the main panel needs to be told about it so that it can show some friendly messages about adding a BlockCode node. However, any non-BlockCode node is represented as null, which means that changes to a selected non-BlockCode node can't be differentiated. Skip the early return in that case. https://phabricator.endlessm.com/T35572
1 parent 5ce3180 commit 518fa9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

addons/block_code/block_code_plugin.gd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ func _on_editor_inspector_edited_object_changed():
138138

139139

140140
func select_block_code_node(block_code: BlockCode):
141-
if block_code == _selected_block_code:
141+
# Skip duplicate selection unless new node is null. That happens when any
142+
# non-BlockCode node is selected and that needs to be passed through to the
143+
# main panel.
144+
if block_code and block_code == _selected_block_code:
142145
return
143146

144147
if not is_block_code_editable(block_code):

0 commit comments

Comments
 (0)