diff options
author | Leleat <atule@pm.me> | 2020-09-12 23:59:46 +0200 |
---|---|---|
committer | Leleat <atule@pm.me> | 2020-09-13 00:32:24 +0200 |
commit | 32e52217ff71195818c270c5203245b99a8beeaf (patch) | |
tree | e919ce1a78861d837f0f8f0760f1c227417fda6a | |
parent | 463879db56cc1e2417a02696e41ae3c40324ac24 (diff) |
striped edges on node rename in SceneTreeDock
-rw-r--r-- | editor/scene_tree_editor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index a62448169d..5a504da397 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -777,6 +777,9 @@ void SceneTreeEditor::_renamed() { return; } + // Trim leading/trailing whitespace to prevent node names from containing accidental whitespace, which would make it more difficult to get the node via `get_node()`. + new_name = new_name.strip_edges(); + if (!undo_redo) { n->set_name(new_name); which->set_metadata(0, n->get_path()); |