diff options
-rw-r--r-- | core/extension/gdnative_interface.h | 1 | ||||
-rw-r--r-- | core/string/ustring.cpp | 11 | ||||
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.h | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 | ||||
-rw-r--r-- | tests/scene/test_text_edit.h | 5 |
6 files changed, 16 insertions, 9 deletions
diff --git a/core/extension/gdnative_interface.h b/core/extension/gdnative_interface.h index 39378d8261..9ac5cc9398 100644 --- a/core/extension/gdnative_interface.h +++ b/core/extension/gdnative_interface.h @@ -231,7 +231,6 @@ typedef void (*GDNativeExtensionClassUnreference)(GDExtensionClassInstancePtr p_ typedef void (*GDNativeExtensionClassCallVirtual)(GDExtensionClassInstancePtr p_instance, const GDNativeTypePtr *p_args, GDNativeTypePtr r_ret); typedef GDNativeObjectPtr (*GDNativeExtensionClassCreateInstance)(void *p_userdata); typedef void (*GDNativeExtensionClassFreeInstance)(void *p_userdata, GDExtensionClassInstancePtr p_instance); -typedef void (*GDNativeExtensionClassObjectInstance)(GDExtensionClassInstancePtr p_instance, GDNativeObjectPtr p_object_instance); typedef GDNativeExtensionClassCallVirtual (*GDNativeExtensionClassGetVirtual)(void *p_userdata, const char *p_name); typedef struct { diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 6218c21cde..dbbcedca84 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3669,13 +3669,16 @@ String String::simplify_path() const { String drive; if (s.begins_with("local://")) { drive = "local://"; - s = s.substr(8, s.length()); + s = s.substr(8); } else if (s.begins_with("res://")) { drive = "res://"; - s = s.substr(6, s.length()); + s = s.substr(6); } else if (s.begins_with("user://")) { drive = "user://"; - s = s.substr(7, s.length()); + s = s.substr(7); + } else if (s.begins_with("uid://")) { + drive = "uid://"; + s = s.substr(6); } else if (is_network_share_path()) { drive = s.substr(0, 2); s = s.substr(2, s.length() - 2); @@ -3689,7 +3692,7 @@ String String::simplify_path() const { } if (p != -1 && p < s.find("/")) { drive = s.substr(0, p + 2); - s = s.substr(p + 2, s.length()); + s = s.substr(p + 2); } } diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index 68bc4389a2..364c3b7246 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -268,8 +268,8 @@ List<int> TilesEditorPlugin::get_sorted_sources(const Ref<TileSet> p_tile_set) c SourceNameComparator::tile_set = p_tile_set; List<int> source_ids; - for (int i = 0; i < tile_set->get_source_count(); i++) { - source_ids.push_back(tile_set->get_source_id(i)); + for (int i = 0; i < p_tile_set->get_source_count(); i++) { + source_ids.push_back(p_tile_set->get_source_id(i)); } switch (source_sort) { diff --git a/editor/plugins/tiles/tiles_editor_plugin.h b/editor/plugins/tiles/tiles_editor_plugin.h index b1fe6f8df6..bdada9ec90 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.h +++ b/editor/plugins/tiles/tiles_editor_plugin.h @@ -122,7 +122,7 @@ public: // Sorting. void set_sorting_option(int p_option); - List<int> get_sorted_sources(const Ref<TileSet> tile_set) const; + List<int> get_sorted_sources(const Ref<TileSet> p_tile_set) const; virtual void edit(Object *p_object) override; virtual bool handles(Object *p_object) const override; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index dafc6b8953..32a9cc5b4c 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4380,7 +4380,7 @@ int TextEdit::add_caret(int p_line, int p_col) { } void TextEdit::remove_caret(int p_caret) { - ERR_FAIL_COND(carets.size() <= 0); + ERR_FAIL_COND_MSG(carets.size() <= 1, "The main caret should not be removed."); ERR_FAIL_INDEX(p_caret, carets.size()); carets.remove_at(p_caret); caret_index_edit_dirty = true; diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h index 6b831bc9c7..3dfbd3e7b6 100644 --- a/tests/scene/test_text_edit.h +++ b/tests/scene/test_text_edit.h @@ -3321,6 +3321,11 @@ TEST_CASE("[SceneTree][TextEdit] muiticaret") { CHECK(text_edit->get_caret_count() == 1); CHECK(text_edit->get_caret_line(0) == 0); CHECK(text_edit->get_caret_column(0) == 1); + + ERR_PRINT_OFF; + text_edit->remove_caret(0); + CHECK(text_edit->get_caret_count() == 1); + ERR_PRINT_ON; } SUBCASE("[TextEdit] caret index edit order") { |