Skip to content

Commit

Permalink
Plugin: Only skip duplicate work when BlockCode nodes selected
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dbnicholson committed Jul 18, 2024
1 parent 5ce3180 commit 518fa9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/block_code/block_code_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ func _on_editor_inspector_edited_object_changed():


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

if not is_block_code_editable(block_code):
Expand Down

0 comments on commit 518fa9b

Please sign in to comment.